vhar_bayes {bvhar} | R Documentation |
Fitting Bayesian VHAR with Coefficient and Covariance Prior
Description
This function fits BVHAR.
Covariance term can be homoskedastic or heteroskedastic (stochastic volatility).
It can have Minnesota, SSVS, and Horseshoe prior.
Usage
vhar_bayes(
y,
har = c(5, 22),
exogen = NULL,
s = 0,
num_chains = 1,
num_iter = 1000,
num_burn = floor(num_iter/2),
thinning = 1,
coef_spec = set_bvhar(),
contem_spec = coef_spec,
cov_spec = set_ldlt(),
intercept = set_intercept(),
exogen_spec = coef_spec,
include_mean = TRUE,
minnesota = c("longrun", "short", "no"),
ggl = TRUE,
save_init = FALSE,
convergence = NULL,
verbose = FALSE,
num_thread = 1
)
## S3 method for class 'bvharsv'
print(x, digits = max(3L, getOption("digits") - 3L), ...)
## S3 method for class 'bvharldlt'
print(x, digits = max(3L, getOption("digits") - 3L), ...)
## S3 method for class 'bvharsv'
knit_print(x, ...)
## S3 method for class 'bvharldlt'
knit_print(x, ...)
Arguments
y |
Time series data of which columns indicate the variables |
har |
Numeric vector for weekly and monthly order. By default, |
exogen |
Unmodeled variables |
s |
Lag of exogeneous variables in VARX(p, s). By default, |
num_chains |
Number of MCMC chains |
num_iter |
MCMC iteration number |
num_burn |
Number of burn-in (warm-up). Half of the iteration is the default choice. |
thinning |
Thinning every thinning-th iteration |
coef_spec |
Coefficient prior specification by |
contem_spec |
Contemporaneous coefficient prior specification by |
cov_spec |
|
intercept |
|
exogen_spec |
Exogenous coefficient prior specification. |
include_mean |
Add constant term (Default: |
minnesota |
Apply cross-variable shrinkage structure (Minnesota-way). Two type: |
ggl |
If |
save_init |
Save every record starting from the initial values ( |
convergence |
Convergence threshold for rhat < convergence. By default, |
verbose |
Print the progress bar in the console. By default, |
num_thread |
Number of threads |
x |
|
digits |
digit option to print |
... |
not used |
Details
Cholesky stochastic volatility modeling for VHAR based on
\Sigma_t^{-1} = L^T D_t^{-1} L
Value
vhar_bayes()
returns an object named bvharsv
class. It is a list with the following components:
- coefficients
Posterior mean of coefficients.
- chol_posterior
Posterior mean of contemporaneous effects.
- param
Every set of MCMC trace.
- param_names
Name of every parameter.
- group
Indicators for group.
- num_group
Number of groups.
- df
Numer of Coefficients:
3m + 1
or3m
- p
3 (The number of terms. It contains this element for usage in other functions.)
- week
Order for weekly term
- month
Order for monthly term
- m
Dimension of the data
- obs
Sample size used when training =
totobs
-p
- totobs
Total number of the observation
- call
Matched call
- process
Description of the model, e.g.
VHAR_SSVS_SV
,VHAR_Horseshoe_SV
, orVHAR_minnesota-part_SV
- type
include constant term (
const
) or not (none
)- spec
Coefficients prior specification
- sv
log volatility prior specification
- init
Initial values
- intercept
Intercept prior specification
- chain
The numer of chains
- iter
Total iterations
- burn
Burn-in
- thin
Thinning
- HARtrans
VHAR linear transformation matrix
- y0
Y_0
- design
X_0
- y
Raw input
If it is SSVS or Horseshoe:
- pip
Posterior inclusion probabilities.
References
Kim, Y. G., and Baek, C. (2024). Bayesian vector heterogeneous autoregressive modeling. Journal of Statistical Computation and Simulation, 94(6), 1139-1157.
Kim, Y. G., and Baek, C. (n.d.). Working paper.