Learn R Programming

⚠️There's a newer version (0.9-2) of this package.Take me there.

MSBVAR (version 0.7-1)

Markov-Switching, Bayesian, Vector Autoregression Models

Description

Provides methods for estimating frequentist and Bayesian Vector Autoregression (VAR) models and Markov-switching Bayesian VAR (MSBVAR). Functions for reduced form and structural VAR models are also available. Includes methods for the generating posterior inferences for these models, forecasts, impulse responses (using likelihood-based error bands), and forecast error decompositions. Also includes utility functions for plotting forecasts and impulse responses, and generating draws from Wishart and singular multivariate normal densities. Current version includes functionality to build and evaluate models with Markov switching.

Copy Link

Version

Install

install.packages('MSBVAR')

Monthly Downloads

19

Version

0.7-1

License

GPL (>= 2)

Maintainer

Patrick Brandt

Last Published

July 26th, 2012

Functions in MSBVAR (0.7-1)

simulateMSAR

Simulate (univariate) Markov-switching autoregressive (MSAR) data
HamiltonGDP

Quarterly U.S. GDP Growth, 1952Q3-1984Q4
BCFdata

Subset of Data from Brandt, Colaresi, and Freeman (2008)
mae

Mean absolute error of VAR forecasts
plot.forc.ecdf

Plots VAR forecasts and their empirical error bands
print.posterior.fit

Print method for posterior fit measures
granger.test

Bivariate Granger causality testing
plot.irf

Plots impulse responses
IsraelPalestineConflict

Weekly Goldstein Scaled Israeli-Palestinian Conflict Data, 1979-2003
irf

Impulse Response Function (IRF) Computation for a VAR
list.print

Prints a list object for the VAR and BVAR models in MSBVAR
mean.SS

Summary measures and plots for MS-B(S)VAR state-spaces
cf.forecasts

Compare VAR forecasts to each other or real data
ldwishart

Log density for a Wishart variate
forc.ecdf

Empirical CDF computations for posterior forecast samples
rmultnorm

Multivariate Normal Random Number Generator
SZ.prior.evaluation

Sims-Zha Bayesian VAR Prior Specification Search
mcmc.szbsvar

Gibbs sampler for coefficients of a B-SVAR model
print.dfev

Printing DFEV tables
plot.gibbs.A0

Plot a parameter density summary for B-SVAR A(0) objects
plot.forecast

Plot function for forecasts
msvar

Markov-switching vector autoregression (MSVAR) estimator
var.lag.specification

Automated VAR lag specification testing
rwishart

Random deviates from a Wishart distribution
restmtx

Utility function for generating the restriction matrix for hard condition forecasting
rmse

Root mean squared error of a Monte Carlo / MCMC sample of forecasts
simulateMSVAR

Simulate a Markov-switching VAR (MSVAR) process
gibbs.msbvar

Gibbs sampler for a Markov-switching Bayesian reduced form vector autoregression model
normalize.svar

Likelihood normalization of SVAR models
rdirichlet

Random draws from and density for Dirichlet distribution
null.space

Find the null space of a matrix
reduced.form.var

Estimation of a reduced form VAR model
summary.forecast

Summary functions for forecasts obtained through VAR / BVAR / B-SVAR model objects
hc.forecast

Forecast density estimation of hard condition forecasts for VAR models via MCMC
plot.mc.irf

Plotting posteriors of Monte Carlo simulated impulse responses
gibbs.A0

Gibbs sampler for posterior of Bayesian structural vector autoregression models
szbsvar

Structural Sims-Zha Bayesian VAR model estimation
initialize.msbvar

Initializes the mode-finder for a Markov-switching Bayesian VAR model
decay.spec

Lag decay specification check
plotregimeid

Clustering and plotting function for msbvar permuted sample output
szbvar

Reduced form Sims-Zha Bayesian VAR model estimation
forecast

Generate forecasts for fitted VAR objects
posterior.fit

Estimates the marginal likelihood or log posterior probability for BVAR, BSVAR, and MSBVAR models
uc.forecast

Forecast density estimation unconditional forecasts for VAR/BVAR/BSVAR models via MCMC
SS.ffbs

State-space forward-filter and backwards-sampler for a Markov-switching VAR model
msbvar

Markov-switching Bayesian reduced form vector autoregression model setup and posterior mode estimation
dfev

Decompositions of Forecast Error Variance (DFEV) for VAR/BVAR/BSVAR models
summary

Summary functions for VAR / BVAR / B-SVAR model objects
A02mcmc

Converts A0 objects to coda MCMC objects
mountains

Mountain plots for summarizing forecast densities
mc.irf

Monte Carlo Integration / Simulation of Impulse Response Functions