set_bvar | R Documentation |
Set hyperparameters of Bayesian VAR and VHAR models.
set_bvar(sigma, lambda = 0.1, delta, eps = 1e-04)
set_bvar_flat(U)
set_bvhar(sigma, lambda = 0.1, delta, eps = 1e-04)
set_weight_bvhar(sigma, lambda = 0.1, eps = 1e-04, daily, weekly, monthly)
## S3 method for class 'bvharspec'
print(x, digits = max(3L, getOption("digits") - 3L), ...)
is.bvharspec(x)
## S3 method for class 'bvharspec'
knit_print(x, ...)
sigma |
Standard error vector for each variable (Default: sd) |
lambda |
Tightness of the prior around a random walk or white noise (Default: .1) |
delta |
Persistence (Default: Litterman sets 1 = random walk prior, White noise prior = 0) |
eps |
Very small number (Default: 1e-04) |
U |
Positive definite matrix. By default, identity matrix of dimension ncol(X0) |
daily |
Same as delta in VHAR type (Default: 1 as Litterman) |
weekly |
Fill the second part in the first block (Default: 1) |
monthly |
Fill the third part in the first block (Default: 1) |
x |
Any object |
digits |
digit option to print |
... |
not used |
Missing arguments will be set to be default values in each model function mentioned above.
set_bvar()
sets hyperparameters for bvar_minnesota()
.
Each delta
(vector), lambda
(length of 1), sigma
(vector), eps
(vector) corresponds to \delta_j
, \lambda
, \delta_j
, \epsilon
.
\delta_i
are related to the belief to random walk.
If \delta_i = 1
for all i, random walk prior
If \delta_i = 0
for all i, white noise prior
\lambda
controls the overall tightness of the prior around these two prior beliefs.
If \lambda = 0
, the posterior is equivalent to prior and the data do not influence the estimates.
If \lambda = \infty
, the posterior mean becomes OLS estimates (VAR).
\sigma_i^2 / \sigma_j^2
in Minnesota moments explain the data scales.
set_bvar_flat
sets hyperparameters for bvar_flat()
.
set_bvhar()
sets hyperparameters for bvhar_minnesota()
with VAR-type Minnesota prior, i.e. BVHAR-S model.
set_weight_bvhar()
sets hyperparameters for bvhar_minnesota()
with VHAR-type Minnesota prior, i.e. BVHAR-L model.
Every function returns bvharspec
class.
It is the list of which the components are the same as the arguments provided.
If the argument is not specified, NULL
is assigned here.
The default values mentioned above will be considered in each fitting function.
Model name: BVAR
, BVHAR
Prior name: Minnesota
(Minnesota prior for BVAR),
Hierarchical
(Hierarchical prior for BVAR),
MN_VAR
(BVHAR-S),
MN_VHAR
(BVHAR-L),
Flat
(Flat prior for BVAR)
Vector value (or bvharpriorspec
class) assigned for sigma
Value (or bvharpriorspec
class) assigned for lambda
Vector value assigned for delta
Value assigned for epsilon
set_weight_bvhar()
has different component with delta
due to its different construction.
Vector value assigned for daily weight
Vector value assigned for weekly weight
Vector value assigned for monthly weight
By using set_psi()
and set_lambda()
each, hierarchical modeling is available.
BaĆbura, M., Giannone, D., & Reichlin, L. (2010). Large Bayesian vector auto regressions. Journal of Applied Econometrics, 25(1).
Litterman, R. B. (1986). Forecasting with Bayesian Vector Autoregressions: Five Years of Experience. Journal of Business & Economic Statistics, 4(1), 25.
Ghosh, S., Khare, K., & Michailidis, G. (2018). High-Dimensional Posterior Consistency in Bayesian Vector Autoregressive Models. Journal of the American Statistical Association, 114(526).
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. (2024). Bayesian vector heterogeneous autoregressive modeling. Journal of Statistical Computation and Simulation, 94(6), 1139-1157.
lambda hyperprior specification set_lambda()
sigma hyperprior specification set_psi()
# Minnesota BVAR specification------------------------
bvar_spec <- set_bvar(
sigma = c(.03, .02, .01), # Sigma = diag(.03^2, .02^2, .01^2)
lambda = .2, # lambda = .2
delta = rep(.1, 3), # delta1 = .1, delta2 = .1, delta3 = .1
eps = 1e-04 # eps = 1e-04
)
class(bvar_spec)
str(bvar_spec)
# Flat BVAR specification-------------------------
# 3-dim
# p = 5 with constant term
# U = 500 * I(mp + 1)
bvar_flat_spec <- set_bvar_flat(U = 500 * diag(16))
class(bvar_flat_spec)
str(bvar_flat_spec)
# BVHAR-S specification-----------------------
bvhar_var_spec <- set_bvhar(
sigma = c(.03, .02, .01), # Sigma = diag(.03^2, .02^2, .01^2)
lambda = .2, # lambda = .2
delta = rep(.1, 3), # delta1 = .1, delta2 = .1, delta3 = .1
eps = 1e-04 # eps = 1e-04
)
class(bvhar_var_spec)
str(bvhar_var_spec)
# BVHAR-L specification---------------------------
bvhar_vhar_spec <- set_weight_bvhar(
sigma = c(.03, .02, .01), # Sigma = diag(.03^2, .02^2, .01^2)
lambda = .2, # lambda = .2
eps = 1e-04, # eps = 1e-04
daily = rep(.2, 3), # daily1 = .2, daily2 = .2, daily3 = .2
weekly = rep(.1, 3), # weekly1 = .1, weekly2 = .1, weekly3 = .1
monthly = rep(.05, 3) # monthly1 = .05, monthly2 = .05, monthly3 = .05
)
class(bvhar_vhar_spec)
str(bvhar_vhar_spec)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.