Learn R Programming

MSBVAR (version 0.7-0)

plot.mc.irf: Plotting posteriors of Monte Carlo simulated impulse responses

Description

Provides a plotting method for the mc.irf Monte Carlo sample of impulse responses. Responses can be plotted with classical or Bayesian error bands, as suggested by Sims and Zha (1999).

Usage

## S3 method for class 'mc.irf':
plot(x, method=c("Sims-Zha2"), component=1,
            probs=c(0.16,0.84), varnames = attr(x, "eqnames"), ...)

Arguments

Value

The primary reason for this function is to plot impulse responses and their error bands. Secondarily, it returns an invisible list of the impulses responses, their error bands, and summary measures of the fractions of the variance in the eigenvector methods that explain the total variation of each response.responsesResponses and their error bandseigenvector.fractionsFraction of the variation in each response that is explained by the chosen eigenvectors. NULL for non-eigenvector methods.

Details

This function plots the output of a Monte Carlo simulation of (B)(BS)VAR impulse response functions produced by mc.irf. The function allows the user to choose among a variety of frequentist (normal appproximation and percentile) and Bayesian (eigendecomposition) methods for constructing error bands around a set of impulse responses. Impulses or shocks are in the columns and the rows are the responses.

References

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.

Sims, C.A. and Tao Zha. 1999. "Error Bands for Impulse Responses." Econometrica. 67(5): 1113-1156.

See Also

See Also mc.irf for the computation of Monte Carlo samples of impulse responses, szbsvar for estimation of the posterior moments of the B-SVAR model, gibbs.A0 for Gibbs sampling the posterior of the $A_0$ for the model, and

Examples

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

posterior.impulses <- mc.irf(fit.BVAR, nsteps=12, draws=1000)
plot(posterior.impulses, method = c("Percentile"))

Run the code above in your browser using DataLab