Learn R Programming

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

BGVAR: Bayesian Global Vector Autoregressions

Estimation of Bayesian Global Vector Autoregressions with different prior setups and the possibility to introduce stochastic volatility. Built-in priors include the SIMS, SSVS and NG prior. Post-processing functions allow for doing predictions, structurally identify the model with short-run or sign-restrictions and compute impulse response function, historical decompositions and forecast error variance decompositions. Plotting functions are also available.

Installation

You can install the latest development version of BGVAR with:

devtools::install_github("mboeck11/BGVAR")

Note that Mac OS needs gfortran binary packages to be installed. See also: https://gcc.gnu.org/wiki/GFortranBinaries.

Usage

The core function of the package is bgvar() to estimate Bayesian Global Vector Autoregressions with different shrinkage prior setups. Calls can be heavily customized with respect to the specification details of the model, the MCMC chain, hyperparameter setup and various extra features. The output of the estimation can then be used for a variety of tools implemented for the BGVAR package.

Predictions are invoked with predict(), impulse responses are computed with IRF(), forecast error variance decompositions can be called with fevd.decomp and historical decompositions with hd.decomp(). Furthermore, counterfactual impulse responses are computed with IRF.cf() and conditional forecasts with cond.pred().

The package comes with standard methods to ease the analysis. The estimation output can be inspected with print(), summary(), fitted(), coef(), vcov() and residuals(). Default plot() is available for most outputs. Various other helper functions to ease analysis are also available.

References

Crespo Cuaresma, J., Feldkircher, M. and F. Huber (2016) Forecasting with Global Vector Autoregressive Models: A Bayesian Approach. Journal of Applied Econometrics, Vol. 31(7), pp. 1371-1391.

Doan, T. R., Litterman, B. R. and C. A. Sims (1984) Forecasting and Conditional Projection Using Realistic Prior Distributions. Econometric Reviews, Vol. 3, pp. 1-100.

George, E.I., Sun, D. and S. Ni (2008) Bayesian stochastic search for var model restrictions. Journal of Econometrics, Vol. 142, pp. 553-580.

Huber, F. and M. Feldkircher (2016) Adaptive Shrinkage in Bayesian Vector Autoregressive Models. Journal of Business and Economic Statistics, Vol. 37(1), pp. 27-39.

Pesaran, M.H., Schuermann T. and S.M. Weiner (2004) Modeling Regional Interdependencies Using a Global Error-Correcting Macroeconometric Model. Journal of Business and Economic Statistics, Vol. 22, pp. 129-162.

Copy Link

Version

Install

install.packages('BGVAR')

Monthly Downloads

689

Version

2.0.0

License

GPL-3

Maintainer

Maximilian Boeck

Last Published

June 19th, 2020

Functions in BGVAR (2.0.0)

conv.diag

MCMC convergence diagnostics
AIC.bgvar

Akaike Information Criterion
BIC.bgvar

Bayesian Information Criterion
cond.pred

Conditional Forecasts
coef.bgvar

Extract model coefficients
avg.pair.cc

Average pairwise cross-sectional correlations
IRF.cf

Counterfactual Analysis
DIC

Deviance Information Criterion
bgvar

BGVAR
IRF

Impulse Response Functions
gfevd.decomp

Generalized Forecast Error Variance Decomposition
list_to_matrix

Convert Input List to Matrix
lps.bgvar.pred

Compute log-predictive scores
plot.bgvar

Plotting function for fitted values
resid.corr.test

Residual autocorrelation test
plot.bgvar.fevd

Plotting Function for Forecast Error Variance Decomposition
matrix_to_list

Convert Input Matrix to List
residuals.bgvar

Extract residuals of Global Vector Autoregression
pesaranData

pesaranData
logLik.bgvar

Extract Log-Likelihood
monthlyData

Monthly EU / G8 countries macroeconomic dataset
eerData

Example data set to replicate Feldkircher and Huber (2016)
hd.decomp

Historical Decomposition
plot.bgvar.resid

Plotting function for residuals
predict.bgvar

Compute predictions
fitted.bgvar

Extract Model Fitted Values
fevd.decomp

Forecast Error Variance Decomposition
plot.bgvar.irf

Plot predictions of bgvar
eerDataspf

eerData extended with expectations data
vcov.bgvar

Extract variance-covariance matrix
rmse.bgvar.predict

Compute root mean squared errors
summary.bgvar

Summarizing Bayesian Global Vector Autoregression Fits
print.bgvar.CD

Print convergence diagnostics
print.bgvar

Print bgvar Output
print.bgvar.lps

Print prediction evaulation
plot.bgvar.pred

Plot predictions of bgvar
print.bgvar.rmse

Print prediction evaulation