View source: R/bvhar-minnesota.R
| bvhar_minnesota | R Documentation |
This function fits BVHAR with Minnesota prior.
bvhar_minnesota(
y,
har = c(5, 22),
num_chains = 1,
num_iter = 1000,
num_burn = floor(num_iter/2),
thinning = 1,
bayes_spec = set_bvhar(),
scale_variance = 0.05,
include_mean = TRUE,
parallel = list(),
verbose = FALSE,
num_thread = 1
)
## S3 method for class 'bvharmn'
print(x, digits = max(3L, getOption("digits") - 3L), ...)
## S3 method for class 'bvharhm'
print(x, digits = max(3L, getOption("digits") - 3L), ...)
## S3 method for class 'bvharmn'
logLik(object, ...)
## S3 method for class 'bvharmn'
AIC(object, ...)
## S3 method for class 'bvharmn'
BIC(object, ...)
is.bvharmn(x)
## S3 method for class 'bvharmn'
knit_print(x, ...)
## S3 method for class 'bvharhm'
knit_print(x, ...)
y |
Time series data of which columns indicate the variables |
har |
Numeric vector for weekly and monthly order. 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 |
bayes_spec |
A BVHAR model specification by |
scale_variance |
Proposal distribution scaling constant to adjust an acceptance rate |
include_mean |
Add constant term (Default: |
parallel |
List the same argument of |
verbose |
Print the progress bar in the console. By default, |
num_thread |
Number of threads |
x |
Any object |
digits |
digit option to print |
... |
not used |
object |
A |
Apply Minnesota prior to Vector HAR: \Phi (VHAR matrices) and \Sigma_e (residual covariance).
\Phi \mid \Sigma_e \sim MN(M_0, \Omega_0, \Sigma_e)
\Sigma_e \sim IW(\Psi_0, \nu_0)
(MN: matrix normal, IW: inverse-wishart)
There are two types of Minnesota priors for BVHAR:
VAR-type Minnesota prior specified by set_bvhar(), so-called BVHAR-S model.
VHAR-type Minnesota prior specified by set_weight_bvhar(), so-called BVHAR-L model.
bvhar_minnesota() returns an object bvharmn class.
It is a list with the following components:
Posterior Mean
Fitted values
Residuals
Posterior mean matrix of Matrix Normal distribution
Posterior precision matrix of Matrix Normal distribution
Posterior scale matrix of posterior inverse-wishart distribution
Posterior shape of inverse-Wishart distribution (\nu_0 - obs + 2). \nu_0: nrow(Dummy observation) - k
Numer of Coefficients: 3m + 1 or 3m
Dimension of the time series
Sample size used when training = totobs - 22
Prior mean matrix of Matrix Normal distribution: M_0
Prior precision matrix of Matrix Normal distribution: \Omega_0^{-1}
Prior scale matrix of inverse-Wishart distribution: \Psi_0
Prior shape of inverse-Wishart distribution: \nu_0
Y_0
X_0
3, this element exists to run the other functions
Order for weekly term
Order for monthly term
Total number of the observation
include constant term (const) or not (none)
VHAR linear transformation matrix: C_{HAR}
Raw input (matrix)
Matched call
Process string in the bayes_spec: BVHAR_MN_VAR (BVHAR-S) or BVHAR_MN_VHAR (BVHAR-L)
Model specification (bvharspec)
It is also normaliw and bvharmod class.
Kim, Y. G., and Baek, C. (2024). Bayesian vector heterogeneous autoregressive modeling. Journal of Statistical Computation and Simulation, 94(6), 1139-1157.
set_bvhar() to specify the hyperparameters of BVHAR-S
set_weight_bvhar() to specify the hyperparameters of BVHAR-L
summary.normaliw() to summarize BVHAR model
# Perform the function using etf_vix dataset
fit <- bvhar_minnesota(y = etf_vix[,1:3])
class(fit)
# Extract coef, fitted values, and residuals
coef(fit)
head(residuals(fit))
head(fitted(fit))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.