Main Content

Bayesian vector autoregression (VAR) model with samples from prior or posterior distribution

The Bayesian VAR model object `empiricalbvarm`

contains samples from the distributions of the coefficients Λ and innovations covariance matrix Σ of a VAR(*p*) model, which MATLAB^{®} uses to characterize the corresponding prior or posterior distributions.

For Bayesian VAR model objects that have an intractable posterior, the `estimate`

function returns an `empiricalbvarm`

object representing the empirical posterior distribution. However, if you have random draws from the prior or posterior distributions of the coefficients and innovations covariance matrix, you can create a Bayesian VAR model with an empirical prior directly by using `empiricalbvarm`

.

creates a `Mdl`

= empiricalbvarm(`numseries`

,`numlags`

,'CoeffDraws',`CoeffDraws`

,'SigmaDraws',`SigmaDraws`

)`numseries`

-D Bayesian VAR(`numlags`

) model object `Mdl`

characterized by the random samples from the prior or posterior distributions of $$\lambda =\text{vec}\left(\Lambda \right)=\text{vec}\left({\left[\begin{array}{ccccccc}{\Phi}_{1}& {\Phi}_{2}& \cdots & {\Phi}_{p}& c& \delta & {\rm B}\end{array}\right]}^{\prime}\right)$$ and Σ, `CoeffDraws`

and `SigmaDraws`

, respectively.

`numseries`

=*m*, a positive integer specifying the number of response time series variables.`numlags`

=*p*, a nonnegative integer specifying the AR polynomial order (that is, number of`numseries`

-by-`numseries`

AR coefficient matrices in the VAR model).

sets writable properties (except `Mdl`

= empiricalbvarm(`numseries`

,`numlags`

,'`CoeffDraws`

',CoeffDraws,'`SigmaDraws`

',SigmaDraws,`Name,Value`

)`NumSeries`

and `P`

) using name-value pair arguments. Enclose each property name in quotes. For example, `empiricalbvarm(3,2,'CoeffDraws',CoeffDraws,'SigmaDraws',SigmaDraws,'SeriesNames',["UnemploymentRate" "CPI" "FEDFUNDS"])`

specifies the random samples from the distributions of λ and Σ and the names of the three response variables.

Because the posterior distributions of a semiconjugate prior model (`semiconjugatebvarm`

) are analytically intractable, `estimate`

returns an `empiricalbvarm`

object that characterizes the posteriors and contains the Gibbs sampler draws from the full conditionals.

`summarize` | Distribution summary statistics of Bayesian vector autoregression (VAR) model |