Learn R Programming

MSBVAR (version 0.2.2)

szbsvar: Structural Sims-Zha Bayesian VAR model estimation

Description

Estimates a Bayesian Structural Vector Autoregression (B-SVAR) model using the prior specified by Sims and Zha (1998)

Usage

szbsvar(Y, p, z = NULL,
                  lambda0, lambda1, lambda3, lambda4, lambda5,
                  mu5, mu6, ident, qm = 4)

Arguments

Value

A list that summarizes the posterior moment of the B-SVAR modelXX$X'X + H_0$ crossproduct moment matrix for the predetermined variables in the model plus the priorXY$X'Y$ for the model, including the dummy observations for mu5 and mu6YY$m \times m$ Crossproduct for the Y's in the modely$T \times m$ input data in dat plus the m dummy observations for datstructural.innovations$T \times m$ structural innovations for the SVAR modelUi$m \times q_i$ Null space matrices that map the columns of $A_0$ to the free parameters of the columnsHpinv.tildePrior covariance for the predetermined and exogenous regression in the B-SVARH0inv.tilde$m$ dimensional list of the prior covariances for the free parameters of the i'th equation in the model's $A_0$ matrixPi.tildelist of $(m^2 p + 1 + h) \times q_i$ matrices of the prior for the parameters for the predetermined variables in the modelHpinv.posterior$(m^2 p + 1 + h) \times m$ matrix of the posterior of the structural parameters for the predetermined variablesP.posteriorlist of $(m^2 p + 1 + h) \times m$ matrices of the posterior of the paramters for the predetermined variables in the modelH0inv.posterior$m$ dimensional list of the posterior covariances for the free parameters of the i'th equation in the model's $A_0$ matrixA0.modeposterior mode of the $A_0$ matrixF.posterior$(m^2 p + 1 + h) \times m$ matrix of the posterior of the structural parameters for the predetermined variablesB.posterior$(m^2 p + 1 + h) \times m$ matrix of the posterior of the reduced form parameters for the predetermined variablesar.coefs$(m^2 p) \times m$ matrix of the posterior of the reduced form autoregressive parametersintercept$m$ dimensional vector of the reduced form interceptsexog.coefs$h \times m$ matrix of the reduced form exogenous variable coefficientspriorList of the prior parameter: c(lambda0,lambda1,lambda3,lambda4,lambda5, mu5, mu6)dfDegrees of freedom for the model: T + number of dummy observations - lag lengthn0$m$ dimensional list of the number of free parameters for the $A_0$ matrix for equation i.ident$m \times m$ identification matrix ident

Warning

If you do not understand the model described here, you probably want the models described in szbvar or reduced.form.var

Details

This function estimates Bayesian structural VAR (B-SVAR) model described by Sims and Zha (1998) and Waggoner and Zha (2003). This B-SVAR model is based a specification of the dynamic simultaneous equation representation of the model. The prior is constructed for the structural parameters.

The basic SVAR model has the form of Waggoner and Zha (2003): $$y_t^\prime A_0 = \sum_{\ell=1}^p Y_{t-\ell}^\prime A_\ell + z_t^\prime D + \epsilon_t^\prime, t = 1, \ldots, T,$$

where $A_i$ are $m \times m$ parameter matrices for the contemporaneous and lagged effects of the endogenous variables, $D$ is an $h \times m$ parameter matrix for the exogenous variables (including an intercept), $y_t$ is the $m \times 1$ matrix of the endogenous variables, $z_t$ is a $h \times 1$ vector of exogenous variables (including an intercept) and $\epsilon_t$ is the $m \times 1$ matrix of structural shocks. NOTE that in this representation of the model, the columns of the $A_\ell$ matrices refer to the equations! The structural shocks are normal with mean and variance equal to the following: $$E[\epsilon_t | y_1, \ldots, y_{t-1}, z_1, \ldots z_{t-1}] = 0$$ $$E[\epsilon_t \epsilon_t^\prime | y_1, \ldots, y_{t-1}, z_1, \ldots z_{t-1}] = I$$

The reduced form representation of the SVAR model can be found by post-multiplying through by $A_0^{-1}$: $$y_t^\prime A_0 A_0^{-1} = \sum_{\ell=1}^p Y_{t-\ell}^\prime A_\ell A_0^{-1} + z_t^\prime DA_0^{-1} + \epsilon_t^\prime A_0^{-1}$$ $$y_t^\prime = \sum_{\ell=1}^p Y_{t-\ell}^\prime B_\ell + z_t^\prime \Gamma + \epsilon_t^\prime A_0^{-1}.$$

The reduced form error covariance matrix is found from the crossproduct of the reduced form innovations: $$\Sigma = E[(\epsilon_t^\prime A_0^{-1})(\epsilon_t^\prime A_0^{-1})^\prime] = [A_0 A_0^\prime]^{-1}.$$.

Restrictions on the contemporaneous parameters in $A_0$ are expressed by the specification of the ident matrix that defines the shocks that "hit" each equation in the contemporaneous specification. If ident is defined as in the following table,

lccc{ Equations Variables Eqn 1 Eqn 2 Eqn 3 Var. 1 1 0 0 Var. 2 1 1 0 Var. 3 0 1 1 }

then the corresponding $A_0$ is restricted to lccc{ Equations Variables Eqn 1 Eqn 2 Eqn 3 Var. 1 $a_{11}$ 0 0 Var. 2 $a_{12}$ $a_{22}$ 0 Var. 3 0 $a_{23}$ $a_{33}$ }

which is interpreted as shocks in variables 1 and 2 hit equation 1 (the first column); shocks in variables 2 and 3 hit the second equation (column 2); and, shocks in variable 3 hit the third equation (column 3).

As in Sims and Zha (1998) and Waggoner and Zha (2003), the prior for the model is formed for each of the equations. To illustrate the prior, the model is written in the more compact notation

$$y_t^\prime A_0 = x_t^\prime F + \epsilon_t^\prime$$ where $$x_t^\prime = [ y_{t-1}^\prime \cdots y_{t-p}^\prime, z_t^\prime], F^\prime = [A_1^\prime \cdots A_p^\prime \, D^\prime]$$ are the matrices of the right hand side variables and the right hand side coefficients for the SVAR model.

The general form of this prior is then $$a_i \sim N(0, \bar{S_i}) \quad \textrm{and} \quad f_i | a_i \sim N(\bar{P}_i a_i, \bar{H}_i)$$

where $\bar{S}_i$ is an $m \times m$ prior covariance of the contemporaneous parameters, and $\bar{H}_i$ is the $k \times k$ prior covariance of the parameters in $f_i | a_i$. The prior means of $a_i$ are zero in the structural model, while the "random walk" component is in $\bar{P}_i a_i$.

The Bayesian prior is constructed for the unrestricted VAR model and then mapped into the restricted prior parameter space, as discussed in Waggoner and Zha (2003a).

References

Sims, C.A. and Tao A. Zha. 1998. "Bayesian Methods for Dynamic Multivariate Models." International Economic Review. 39(4):949-968.

Waggoner, Daniel F. and Tao A. Zha. 2003a. "A Gibbs sampler for structural vector autoregressions" Journal of Economic Dynamics & Control. 28:349--366.

Waggoner, Daniel F. and Tao A. Zha. 2003b. "Likelihood preserving normalization in multiple equation models". Journal of Econometrics. 114: 329--347.

Brandt, Patrick T. and John R. Freeman. 2006. "Advances in Bayesian Time Series Modeling and the Study of Politics: Theory Testing, Forecasting, and Policy Analysis". Political Analysis 14(1):1-36.

See Also

szbvar for reduced form Bayesian VAR models, reduced.form.var for non-Bayesian reduced form VAR models, gibbs.A0 for drawing from the posterior of this model using a Gibbs sampler, posterior.fit for assessing the posterior fit of the model, and mc.irf for computing impulse responses for this model.

Examples

Run this code
# generates "ident" consistent with the help example
m <- ncol(Y)
ident <- diag(m)
ident[2,1] <- 1
ident[3,2] <- 1

# estimate the model's posterior moments
szbsvar(Y, p, z=NULL, lambda0, lambda1, lambda3, lambda4, lambda5, mu5,
        mu6, ident, qm=4)

Run the code above in your browser using DataLab