This function fits BVAR(p) with Minnesota prior.
bvar_minnesota(
y,
p = 1,
num_chains = 1,
num_iter = 1000,
num_burn = floor(num_iter/2),
thinning = 1,
bayes_spec = set_bvar(),
scale_variance = 0.05,
include_mean = TRUE,
parallel = list(),
verbose = FALSE,
num_thread = 1
)# S3 method for bvarmn
print(x, digits = max(3L, getOption("digits") - 3L), ...)
# S3 method for bvarhm
print(x, digits = max(3L, getOption("digits") - 3L), ...)
# S3 method for bvarmn
logLik(object, ...)
# S3 method for bvarmn
AIC(object, ...)
# S3 method for bvarmn
BIC(object, ...)
is.bvarmn(x)
# S3 method for bvarmn
knit_print(x, ...)
# S3 method for bvarhm
knit_print(x, ...)
bvar_minnesota() returns an object bvarmn
class. It is a list with the following components:
Posterior Mean
Fitted values
Residuals
Posterior mean matrix of Matrix Normal distribution
Posterior precision matrix of Matrix Normal distribution
Posterior scale matrix of posterior inverse-Wishart distribution
Posterior shape of inverse-Wishart distribution (\(alpha_0\) - obs + 2). \(\alpha_0\): nrow(Dummy observation) - k
Numer of Coefficients: mp + 1 or mp
Dimension of the time series
Sample size used when training = totobs - p
Prior mean matrix of Matrix Normal distribution: \(A_0\)
Prior precision matrix of Matrix Normal distribution: \(\Omega_0^{-1}\)
Prior scale matrix of inverse-Wishart distribution: \(S_0\)
Prior shape of inverse-Wishart distribution: \(\alpha_0\)
\(Y_0\)
\(X_0\)
Lag of VAR
Total number of the observation
include constant term (const) or not (none)
Raw input (matrix)
Matched call
Process string in the bayes_spec: BVAR_Minnesota
Model specification (bvharspec)
It is also normaliw and bvharmod class.
Time series data of which columns indicate the variables
VAR lag (Default: 1)
Number of MCMC chains
MCMC iteration number
Number of burn-in (warm-up). Half of the iteration is the default choice.
Thinning every thinning-th iteration
A BVAR model specification by set_bvar().
Proposal distribution scaling constant to adjust an acceptance rate
Add constant term (Default: TRUE) or not (FALSE)
List the same argument of optimParallel::optimParallel(). By default, this is empty, and the function does not execute parallel computation.
Print the progress bar in the console. By default, FALSE.
Number of threads
Any object
digit option to print
not used
A bvarmn object
Minnesota prior gives prior to parameters \(A\) (VAR matrices) and \(\Sigma_e\) (residual covariance).
$$A \mid \Sigma_e \sim MN(A_0, \Omega_0, \Sigma_e)$$ $$\Sigma_e \sim IW(S_0, \alpha_0)$$ (MN: matrix normal, IW: inverse-wishart)
Bańbura, M., Giannone, D., & Reichlin, L. (2010). Large Bayesian vector auto regressions. Journal of Applied Econometrics, 25(1).
Giannone, D., Lenza, M., & Primiceri, G. E. (2015). Prior Selection for Vector Autoregressions. Review of Economics and Statistics, 97(2).
Litterman, R. B. (1986). Forecasting with Bayesian Vector Autoregressions: Five Years of Experience. Journal of Business & Economic Statistics, 4(1), 25.
KADIYALA, K.R. and KARLSSON, S. (1997), NUMERICAL METHODS FOR ESTIMATION AND INFERENCE IN BAYESIAN VAR-MODELS. J. Appl. Econ., 12: 99-132.
Karlsson, S. (2013). Chapter 15 Forecasting with Bayesian Vector Autoregression. Handbook of Economic Forecasting, 2, 791-897.
Sims, C. A., & Zha, T. (1998). Bayesian Methods for Dynamic Multivariate Models. International Economic Review, 39(4), 949-968.
set_bvar() to specify the hyperparameters of Minnesota prior.
summary.normaliw() to summarize BVAR model
# Perform the function using etf_vix dataset
fit <- bvar_minnesota(y = etf_vix[,1:3], p = 2)
class(fit)
# Extract coef, fitted values, and residuals
coef(fit)
head(residuals(fit))
head(fitted(fit))
Run the code above in your browser using DataLab