This function fits BVAR(p) with stochastic search variable selection (SSVS) prior.
bvhar_ssvs(
y,
har = c(5, 22),
num_chains = 1,
num_iter = 1000,
num_burn = floor(num_iter/2),
thinning = 1,
bayes_spec = choose_ssvs(y = y, ord = har, type = "VHAR", param = c(0.1, 10),
include_mean = include_mean, gamma_param = c(0.01, 0.01), mean_non = 0, sd_non = 0.1),
init_spec = init_ssvs(type = "auto"),
include_mean = TRUE,
minnesota = c("no", "short", "longrun"),
verbose = FALSE,
num_thread = 1
)# S3 method for bvharssvs
print(x, digits = max(3L, getOption("digits") - 3L), ...)
# S3 method for bvharssvs
knit_print(x, ...)
bvhar_ssvs
returns an object named bvharssvs
class. It is a list with the following components:
Posterior mean of VAR coefficients.
Posterior mean of cholesky factor matrix
Posterior mean of covariance matrix
Posterior mean of omega
Posterior inclusion probability
posterior::draws_df with every variable: alpha, eta, psi, omega, and gamma
Name of every parameter.
Numer of Coefficients: 3m + 1
or 3m
3 (The number of terms. It contains this element for usage in other functions.)
Order for weekly term
Order for monthly term
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
include constant term (const
) or not (none
)
SSVS specification defined by set_ssvs()
Initial specification defined by init_ssvs()
The numer of chains
Total iterations
Burn-in
Thinning
Indicators for group.
Number of groups.
VHAR linear transformation matrix
\(Y_0\)
\(X_0\)
Raw input
Time series data of which columns indicate the variables
Numeric vector for weekly and monthly order. By default, c(5, 22)
.
Number of MCMC chains
MCMC iteration number
Number of warm-up (burn-in). Half of the iteration is the default choice.
Thinning every thinning-th iteration
A SSVS model specification by set_ssvs()
. By default, use a default semiautomatic approach choose_ssvs()
.
SSVS initialization specification by init_ssvs()
. By default, use OLS for coefficient and cholesky factor while 1 for dummies.
Add constant term (Default: TRUE
) or not (FALSE
)
Apply cross-variable shrinkage structure (Minnesota-way). Two type: short
type and longrun
type. By default, no
.
Print the progress bar in the console. By default, FALSE
.
bvharssvs
object
digit option to print
not used
SSVS prior gives prior to parameters \(\alpha = vec(A)\) (VAR coefficient) and \(\Sigma_e^{-1} = \Psi \Psi^T\) (residual covariance).
$$\alpha_j \mid \gamma_j \sim (1 - \gamma_j) N(0, \kappa_{0j}^2) + \gamma_j N(0, \kappa_{1j}^2)$$ $$\gamma_j \sim Bernoulli(q_j)$$
and for upper triangular matrix \(\Psi\),
$$\psi_{jj}^2 \sim Gamma(shape = a_j, rate = b_j)$$ $$\psi_{ij} \mid w_{ij} \sim (1 - w_{ij}) N(0, \kappa_{0,ij}^2) + w_{ij} N(0, \kappa_{1,ij}^2)$$ $$w_{ij} \sim Bernoulli(q_{ij})$$
Gibbs sampler is used for the estimation.
Kim, Y. G., and Baek, C. (n.d.). Working paper.