This function fits BVAR.
Covariance term can be homoskedastic or heteroskedastic (stochastic volatility).
It can have Minnesota, SSVS, and Horseshoe prior.
var_bayes(
y,
p,
num_chains = 1,
num_iter = 1000,
num_burn = floor(num_iter/2),
thinning = 1,
bayes_spec = set_bvar(),
cov_spec = set_ldlt(),
intercept = set_intercept(),
include_mean = TRUE,
minnesota = TRUE,
ggl = TRUE,
save_init = FALSE,
convergence = NULL,
verbose = FALSE,
num_thread = 1
)# S3 method for bvarsv
print(x, digits = max(3L, getOption("digits") - 3L), ...)
# S3 method for bvarldlt
print(x, digits = max(3L, getOption("digits") - 3L), ...)
# S3 method for bvarsv
knit_print(x, ...)
# S3 method for bvarldlt
knit_print(x, ...)
var_bayes()
returns an object named bvarsv
Posterior mean of coefficients.
Posterior mean of contemporaneous effects.
Every set of MCMC trace.
Name of every parameter.
Indicators for group.
Number of groups.
Numer of Coefficients: 3m + 1
or 3m
VAR lag
Dimension of the data
Sample size used when training = totobs
- p
Total number of the observation
Matched call
Description of the model, e.g. VHAR_SSVS_SV
, VHAR_Horseshoe_SV
, or VHAR_minnesota-part_SV
include constant term (const
) or not (none
)
Coefficients prior specification
log volatility prior specification
Intercept prior specification
Initial values
The numer of chains
Total iterations
Burn-in
Thinning
\(Y_0\)
\(X_0\)
Raw input
If it is SSVS or Horseshoe:
Posterior inclusion probabilities.
Time series data of which columns indicate the variables
VAR lag
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()
, set_ssvs()
, or set_horseshoe()
.
Add constant term (Default: TRUE
) or not (FALSE
)
Apply cross-variable shrinkage structure (Minnesota-way). By default, TRUE
.
If TRUE
(default), use additional group shrinkage parameter for group structure.
Otherwise, use group shrinkage parameter instead of global shirnkage parameter.
Applies to HS, NG, and DL priors.
Save every record starting from the initial values (TRUE
).
By default, exclude the initial values in the record (FALSE
), even when num_burn = 0
and thinning = 1
.
If num_burn > 0
or thinning != 1
, this option is ignored.
Convergence threshold for rhat < convergence. By default, NULL
which means no warning.
Print the progress bar in the console. By default, FALSE
.
Number of threads
bvarldlt
object
digit option to print
not used
Cholesky stochastic volatility modeling for VAR based on $$\Sigma_t^{-1} = L^T D_t^{-1} L$$, and implements corrected triangular algorithm for Gibbs sampler.
Carriero, A., Chan, J., Clark, T. E., & Marcellino, M. (2022). Corrigendum to “Large Bayesian vector autoregressions with stochastic volatility and non-conjugate priors” [J. Econometrics 212 (1)(2019) 137-154]. Journal of Econometrics, 227(2), 506-512.
Chan, J., Koop, G., Poirier, D., & Tobias, J. (2019). Bayesian Econometric Methods (2nd ed., Econometric Exercises). Cambridge: Cambridge University Press.
Cogley, T., & Sargent, T. J. (2005). Drifts and volatilities: monetary policies and outcomes in the post WWII US. Review of Economic Dynamics, 8(2), 262-302.
Gruber, L., & Kastner, G. (2022). Forecasting macroeconomic data with Bayesian VARs: Sparse or dense? It depends! arXiv.
Huber, F., Koop, G., & Onorante, L. (2021). Inducing Sparsity and Shrinkage in Time-Varying Parameter Models. Journal of Business & Economic Statistics, 39(3), 669-683.
Korobilis, D., & Shimizu, K. (2022). Bayesian Approaches to Shrinkage and Sparse Estimation. Foundations and Trends® in Econometrics, 11(4), 230-354.
Ray, P., & Bhattacharya, A. (2018). Signal Adaptive Variable Selector for the Horseshoe Prior. arXiv.