Learn R Programming

MSBVAR (version 0.2.2)

szbvar: Reduced form Sims-Zha Bayesian VAR model estimation

Description

Estimation of the Bayesian VAR model for just identified VARs described in Sims and Zha (1998)

Usage

szbvar(dat, p, z = NULL, lambda0, lambda1, lambda3, lambda4, lambda5,
       mu5, mu6, nu = ncol(dat)+1, qm = 4, prior = 0,
       posterior.fit = FALSE)

Arguments

Value

Returns a list of multiple elements. This is a workhorse function to get the estimates, so nothing is displayed to the screen. The elements of the list are intended as inputs for the various post-estimation functions (e.g., impulse response analyses, forecasting, decompositions of forecast error variance, etc.)

Returns a list of the class "BVAR" with the following elements:intercept$m \times 1$ row vector of the $m$ interceptsar.coefs$m \times m \times p$ array of the AR coefficients. The first $m \times m$ array is for lag 1, the p'th array for lag p.exog.coefs{$k \times m$ matrix of the coefficients for any exogenous variables}Bhat$(mp + k + 1) \times m$ matrix of the coefficients, where the columns correspond to the variables in the VARvcv$m \times m$ matrix of the maximum likelihood estimate of the residual covariancevcv.BhPosterior estimate of the parameter covariance that is conformable with Bhat.mean.S$m \times m$ matrix of the posterior residual covariance.St{ $m \times m$ matrix of the degrees of freedom times the posterior residual covariance.}hstar$(mp + k + 1) \times (mp + k + 1)$ prior precision plus right hand side variables crossproduct.hstarinv$(mp + k + 1) \times (mp + k + 1)$ prior covariance crossproduct solve(hstar)H0$(mp + k + 1) \times (mp + k + 1)$ prior precision for the parametersS0$m \times m$ prior error covarianceresiduals$(T-p) \times m$ matrix of the residualsX$T \times (mp + 1 + k)$ matrix of right hand side variables for the estimation of BVARY$T \times m$ matrix of the left hand side variables for the estimation of BVARy$T \times m$ input data in datz$T \times k$ exogenous variables matrixpLag lengthnum.exogNumber of exogenous variablesqmValue of parameter to match quarterly to monthly lag decay (4 or 12)prior.typeNumeric code for prior type: 0 = Normal-Wishart, 1 = Normal-Flat, 2 = Flat-Flat (approximate MLE)prior{List of the prior parameter: c(lambda0,lambda1,lambda3,lambda4,lambda5, mu5, mu6, nu)}marg.llfValue of the in-sample marginal log-likelihood for the data, if posterior.fit=Tmarg.postValue of the in-sample marginal log posterior of the data, if posterior.fit=Tcoef.postValue of the marginal log posterior estimate of the coefficients, if posterior.fit=T

Details

This function estimates the Bayesian VAR (BVAR) model described by Sims and Zha (1998). This BVAR 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 used here is

References

Sims, C.A. and Tao Zha. 1998. "Bayesian Methods for Dynamic Multivariate Models." International Economic Review. 39(4):949-968. 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.

See Also

reduced.form.var szbsvar

Examples

Run this code
data(IsraelPalestineConflict)
    varnames <- colnames(IsraelPalestineConflict)

    fit.BVAR <- szbvar(IsraelPalestineConflict, p=6, z=NULL,
                           lambda0=0.6, lambda1=0.1,
                            lambda3=2, lambda4=0.25, lambda5=0, mu5=0,
                            mu6=0, nu=3, qm=4,
                            prior=0, posterior.fit=FALSE)

    # Draw from the posterior pdf of the impulse responses.
    posterior.impulses <- mc.irf(fit.BVAR, nsteps=10, draws=5000)

    # Plot the responses
    plot(posterior.impulses, method=c("Sims-Zha2"), component=1,
         probs=c(0.16,0.84), varnames=varnames)

Run the code above in your browser using DataLab