Bayesian Variable Selection
bvs
employs Bayesian variable selection as proposed by Korobilis (2013)
to produce a vector of inclusion parameters for the coefficient matrix
of a VAR model.
bvs(y, z, a, lambda, sigma_i, prob_prior, include = NULL)
y |
a K \times T matrix of the endogenous variables. |
z |
a KT \times M matrix of explanatory variables. |
a |
an M-dimensional vector of parameter draws. If time varying parameters are used, an M \times T coefficient matrix can be provided. |
lambda |
an M \times M inclusion matrix that should be updated. |
sigma_i |
the inverse variance-covariance matrix. If the variance-covariance matrix is time varying, a KT \times K matrix can be provided. |
prob_prior |
an M-dimensional vector of prior inclusion probabilities. |
include |
an integer vector specifying the positions of variables, which should be
included in the BVS algorithm. If |
The function employs Bayesian variable selection as proposed by Korobilis (2013) to produce a vector of inclusion parameters, which are the diagonal elements of the inclusion matrix Λ for the VAR model
y_t = Z_t Λ a_t + u_t,
where u_t \sim N(0, Σ_{t}). y_t is a K-dimensional vector of endogenous variables and Z_t = x_t^{\prime} \otimes I_K is a K \times M matrix of regressors with x_t as a vector of regressors.
A matrix of inclusion parameters on its diagonal.
Korobilis, D. (2013). VAR forecasting using Bayesian variable selection. Journal of Applied Econometrics, 28(2), 204–230. doi: 10.1002/jae.1271
# Load data data("e1") data <- diff(log(e1)) * 100 # Generate model data temp <- gen_var(data, p = 2, deterministic = "const") y <- t(temp$data$Y) z <- temp$data$SUR tt <- ncol(y) m <- ncol(z) # Priors a_mu_prior <- matrix(0, m) a_v_i_prior <- diag(0.1, m) # Prior for inclusion parameter prob_prior <- matrix(0.5, m) # Initial value of Sigma sigma <- tcrossprod(y) / tt sigma_i <- solve(sigma) lambda <- diag(1, m) z_bvs <- z %*% lambda a <- post_normal_sur(y = y, z = z_bvs, sigma_i = sigma_i, a_prior = a_mu_prior, v_i_prior = a_v_i_prior) lambda <- bvs(y = y, z = z, a = a, lambda = lambda, sigma_i = sigma_i, prob_prior = prob_prior)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.