VARMAX Procedure

Bayesian VAR and VARX Modeling

Consider the VAR(p) model

StartLayout 1st Row  bold y Subscript t Baseline equals bold-italic delta plus normal upper Phi 1 bold y Subscript t minus 1 Baseline plus midline-horizontal-ellipsis plus normal upper Phi Subscript p Baseline bold y Subscript t minus p Baseline plus bold-italic epsilon Subscript t EndLayout

or

StartLayout 1st Row  bold y equals left-parenthesis upper X circled-times upper I Subscript k Baseline right-parenthesis bold-italic beta plus bold e EndLayout

When the parameter vector bold-italic beta has a prior multivariate normal distribution with known mean bold-italic beta Superscript asterisk and covariance matrix upper V Subscript beta, the prior density is written as

StartLayout 1st Row  f left-parenthesis bold-italic beta right-parenthesis equals left-parenthesis StartFraction 1 Over 2 pi EndFraction right-parenthesis Superscript k squared p slash 2 Baseline StartAbsoluteValue upper V Subscript beta Baseline EndAbsoluteValue Superscript negative 1 slash 2 Baseline exp left-bracket minus one-half left-parenthesis bold-italic beta minus bold-italic beta Superscript asterisk Baseline right-parenthesis upper V Subscript beta Superscript negative 1 Baseline left-parenthesis bold-italic beta minus bold-italic beta Superscript asterisk Baseline right-parenthesis right-bracket EndLayout

The likelihood function for the Gaussian process becomes

StartLayout 1st Row 1st Column script l left-parenthesis bold-italic beta vertical-bar bold y right-parenthesis 2nd Column equals 3rd Column left-parenthesis StartFraction 1 Over 2 pi EndFraction right-parenthesis Superscript k upper T slash 2 Baseline StartAbsoluteValue upper I Subscript upper T Baseline circled-times normal upper Sigma EndAbsoluteValue Superscript negative 1 slash 2 times 2nd Row 1st Column Blank 2nd Column Blank 3rd Column exp left-bracket minus one-half left-parenthesis bold y minus left-parenthesis upper X circled-times upper I Subscript k Baseline right-parenthesis bold-italic beta right-parenthesis prime left-parenthesis upper I Subscript upper T Baseline circled-times normal upper Sigma Superscript negative 1 Baseline right-parenthesis left-parenthesis bold y minus left-parenthesis upper X circled-times upper I Subscript k Baseline right-parenthesis bold-italic beta right-parenthesis right-bracket EndLayout

Therefore, the posterior density is derived as

StartLayout 1st Row  f left-parenthesis bold-italic beta vertical-bar bold y right-parenthesis proportional-to exp left-bracket minus one-half left-parenthesis bold-italic beta minus bold-italic beta overbar right-parenthesis prime normal upper Sigma overbar Subscript beta Superscript negative 1 Baseline left-parenthesis bold-italic beta minus bold-italic beta overbar right-parenthesis right-bracket EndLayout

where the posterior mean is

StartLayout 1st Row  bold-italic beta overbar equals left-bracket upper V Subscript beta Superscript negative 1 Baseline plus left-parenthesis upper X prime upper X circled-times normal upper Sigma Superscript negative 1 Baseline right-parenthesis right-bracket Superscript negative 1 Baseline left-bracket upper V Subscript beta Superscript negative 1 Baseline bold-italic beta Superscript asterisk Baseline plus left-parenthesis upper X prime circled-times normal upper Sigma Superscript negative 1 Baseline right-parenthesis bold y right-bracket EndLayout

and the posterior covariance matrix is

StartLayout 1st Row  normal upper Sigma overbar Subscript beta Baseline equals left-bracket upper V Subscript beta Superscript negative 1 Baseline plus left-parenthesis upper X prime upper X circled-times normal upper Sigma Superscript negative 1 Baseline right-parenthesis right-bracket Superscript negative 1 EndLayout

In practice, the prior mean bold-italic beta Superscript asterisk and the prior variance upper V Subscript beta need to be specified. If all the parameters are considered to shrink toward zero, the null prior mean should be specified. According to Litterman (1986), the prior variance can be given by

StartLayout 1st Row  v Subscript i j Baseline left-parenthesis l right-parenthesis equals StartLayout Enlarged left-brace 1st Row 1st Column left-parenthesis lamda slash l right-parenthesis squared 2nd Column if i equals j 2nd Row 1st Column left-parenthesis lamda theta sigma Subscript i i Baseline slash l sigma Subscript j j Baseline right-parenthesis squared 2nd Column if i not-equals j EndLayout EndLayout

where v Subscript i j Baseline left-parenthesis l right-parenthesis is the prior variance of the (i, j) element of normal upper Phi Subscript l, lamda is the prior standard deviation of the diagonal elements of normal upper Phi Subscript l, theta is a constant in the interval left-parenthesis 0 comma 1 right-parenthesis, and sigma Subscript i i Superscript 2 is the ith diagonal element of normal upper Sigma. The deterministic terms have diffused prior variance. In practice, you replace the sigma Subscript i i Superscript 2 by the diagonal element of the ML estimator of normal upper Sigma in the nonconstrained model.

For example, for a bivariate BVAR(2) model,

StartLayout 1st Row 1st Column y Subscript 1 t 2nd Column equals 3rd Column 0 plus phi Subscript 1 comma 11 Baseline y Subscript 1 comma t minus 1 plus phi Subscript 1 comma 12 Baseline y Subscript 2 comma t minus 1 plus phi Subscript 2 comma 11 Baseline y Subscript 1 comma t minus 2 plus phi Subscript 2 comma 12 Baseline y Subscript 2 comma t minus 2 plus epsilon Subscript 1 t 2nd Row 1st Column y Subscript 2 t 2nd Column equals 3rd Column 0 plus phi Subscript 1 comma 21 Baseline y Subscript 1 comma t minus 1 plus phi Subscript 1 comma 22 Baseline y Subscript 2 comma t minus 1 plus phi Subscript 2 comma 21 Baseline y Subscript 1 comma t minus 2 plus phi Subscript 2 comma 22 Baseline y Subscript 2 comma t minus 2 plus epsilon Subscript 2 t EndLayout

with the prior covariance matrix

StartLayout 1st Row 1st Column upper V Subscript beta Baseline equals normal upper D normal i normal a normal g 2nd Column left-parenthesis 3rd Column normal infinity comma lamda squared comma left-parenthesis lamda theta sigma 1 slash sigma 2 right-parenthesis squared comma left-parenthesis lamda slash 2 right-parenthesis squared comma left-parenthesis lamda theta sigma 1 slash 2 sigma 2 right-parenthesis squared comma 2nd Row 1st Column Blank 2nd Column Blank 3rd Column normal infinity comma left-parenthesis lamda theta sigma 2 slash sigma 1 right-parenthesis squared comma lamda squared comma left-parenthesis lamda theta sigma 2 slash 2 sigma 1 right-parenthesis squared comma left-parenthesis lamda slash 2 right-parenthesis squared right-parenthesis EndLayout

For the Bayesian estimation of integrated systems, the prior mean is set to the first lag of each variable equal to one in its own equation and all other coefficients at zero. For example, for a bivariate BVAR(2) model,

StartLayout 1st Row 1st Column y Subscript 1 t 2nd Column equals 3rd Column 0 plus 1 y Subscript 1 comma t minus 1 Baseline plus 0 y Subscript 2 comma t minus 1 Baseline plus 0 y Subscript 1 comma t minus 2 Baseline plus 0 y Subscript 2 comma t minus 2 Baseline plus epsilon Subscript 1 t Baseline 2nd Row 1st Column y Subscript 2 t 2nd Column equals 3rd Column 0 plus 0 y Subscript 1 comma t minus 1 Baseline plus 1 y Subscript 2 comma t minus 1 Baseline plus 0 y Subscript 1 comma t minus 2 Baseline plus 0 y Subscript 2 comma t minus 2 Baseline plus epsilon Subscript 2 t Baseline EndLayout

Forecasting of BVAR Modeling

The mean squared error (MSE) is used to measure forecast accuracy (Litterman 1986). The MSE of the s-step-ahead forecast is

normal upper M normal upper S normal upper E Subscript s Baseline equals StartFraction 1 Over upper J minus s plus 1 EndFraction sigma-summation Underscript j equals 1 Overscript upper J minus s plus 1 Endscripts left-parenthesis upper A Subscript t Sub Subscript j Subscript Baseline minus upper F Subscript t Sub Subscript j Subscript Superscript s Baseline right-parenthesis squared

where J is the number specified by NREP= option, t Subscript j is the time index of the observation to be forecasted in repetition j, upper A Subscript t Sub Subscript j is the actual value at time t Subscript j, and upper F Subscript t Sub Subscript j Superscript s is the forecast made s periods earlier. If there are not enough observations, some MSEs might not be calculated.

Bayesian VARX Modeling

The Bayesian vector autoregressive model with exogenous variables is called the BVARX(p,s) model. The form of the BVARX(p,s) model can be written as

StartLayout 1st Row  bold y Subscript t Baseline equals bold-italic delta plus sigma-summation Underscript i equals 1 Overscript p Endscripts normal upper Phi Subscript i Baseline bold y Subscript t minus i Baseline plus sigma-summation Underscript i equals 0 Overscript s Endscripts normal upper Theta Subscript i Superscript asterisk Baseline bold x Subscript t minus i Baseline plus bold-italic epsilon Subscript t EndLayout

The parameter estimates can be obtained by representing the general form of the multivariate linear model,

StartLayout 1st Row  bold y equals left-parenthesis upper X circled-times upper I Subscript k Baseline right-parenthesis bold-italic beta plus bold e EndLayout

The prior means for the AR coefficients are the same as those specified in BVAR(p). The prior means for the exogenous coefficients are set to zero.

Some examples of the Bayesian VARX model are as follows:

model y1 y2 = x1 / p=1 xlag=1 prior;
model y1 y2 = x1 / p=(1 3) xlag=1 nocurrentx
                   prior=(lambda=0.9 theta=0.1);
Last updated: June 19, 2025