Main Content

Forecast responses from Bayesian vector autoregression (VAR) model

`forecast`

is well suited for computing out-of-sample unconditional forecasts of a Bayesian VAR(*p*) model that does not contain an exogenous regression component. For advanced applications, such as out-of-sample conditional forecasting, VARX(*p*) model forecasting, missing value imputation, and Gibbs sampler specification for posterior predictive distribution estimation, see `simsmooth`

.

returns a path of forecasted responses `YF`

= forecast(`PriorMdl`

,`numperiods`

,`Y`

)`YF`

over the length `numperiods`

forecast horizon. Each period in `YF`

is the mean of the posterior predictive distribution, which is derived from the posterior distribution of the prior Bayesian VAR(*p*) model
`PriorMdl`

given the response data `Y`

. The output `YF`

represents the continuation of `Y`

.

`NaN`

s in the data indicate missing values, which `forecast`

removes using list-wise deletion.

Monte Carlo simulation is subject to variation. If

`forecast`

uses Monte Carlo simulation, then estimates and inferences might vary when you call`forecast`

multiple times under seemingly equivalent conditions. To reproduce estimation results, set a random number seed by using`rng`

before calling`forecast`

.

If the posterior predictive distribution is analytically intractable (true for most cases),

`forecast`

implements Markov Chain Monte Carlo (MCMC) sampling with Bayesian data augmentation to compute the mean and standard deviation of the posterior predictive distribution. To do so,`forecast`

calls`simsmooth`

, which uses a computationally intensive procedure.Most Econometrics Toolbox™

`forecast`

functions accept an estimated or posterior model object from which to generate forecasts. Such a model encompasses the parametric structure and data. However, the`forecast`

function of Bayesian VAR models requires presample and estimation sample data to do the following:Perform Bayesian parameter updating to estimate posterior distributions.

`forecast`

implements MCMC sampling with Bayesian data augmentation, which includes a Kalman filter smoothing step that requires the entire observed series.Predict future responses in the presence of two sources of uncertainty:

Estimation noise

*ε*_{1},…,*ε*_{T}, which induces parameter uncertaintyForecast period noise

*ε*_{T+1},…,*ε*_{T+numperiods}

[1] Litterman, Robert B. "Forecasting with Bayesian Vector Autoregressions: Five Years of Experience." *Journal of Business and Economic Statistics* 4, no. 1 (January 1986): 25–38. https://doi.org/10.2307/1391384.