bvhar_minnesota {bvhar} | R Documentation |
Fitting Bayesian VHAR of Minnesota Prior
Description
This function fits BVHAR with Minnesota prior.
Usage
bvhar_minnesota(
y,
har = c(5, 22),
bayes_spec = set_bvhar(),
include_mean = TRUE
)
## S3 method for class 'bvharmn'
print(x, digits = max(3L, getOption("digits") - 3L), ...)
## S3 method for class 'bvharmn'
knit_print(x, ...)
Arguments
y |
Time series data of which columns indicate the variables |
har |
Numeric vector for weekly and monthly order. By default, |
bayes_spec |
A BVHAR model specification by |
include_mean |
Add constant term (Default: |
x |
|
digits |
digit option to print |
... |
not used |
Details
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.
Two types of Minnesota priors builds different dummy variables for Y0. See var_design_formulation.
Value
bvhar_minnesota()
returns an object bvharmn
class.
It is a list with the following components:
- coefficients
Posterior Mean matrix of Matrix Normal distribution
- fitted.values
Fitted values
- residuals
Residuals
- mn_prec
Posterior precision matrix of Matrix Normal distribution
- iw_scale
Posterior scale matrix of posterior inverse-wishart distribution
- iw_shape
Posterior shape of inverse-Wishart distribution (
\nu_0
- obs + 2).\nu_0
: nrow(Dummy observation) - k- df
Numer of Coefficients: 3m + 1 or 3m
- p
3, this element exists to run the other functions
- week
Order for weekly term
- month
Order for monthly term
- m
Dimension of the time series
- obs
Sample size used when training =
totobs
- 22- totobs
Total number of the observation
- call
Matched call
- process
Process string in the
bayes_spec
:"BVHAR_MN_VAR"
(BVHAR-S) or"BVHAR_MN_VHAR"
(BVHAR-L)- spec
Model specification (
bvharspec
)- type
include constant term (
"const"
) or not ("none"
)- prior_mean
Prior mean matrix of Matrix Normal distribution:
M_0
- prior_precision
Prior precision matrix of Matrix Normal distribution:
\Omega_0^{-1}
- prior_scale
Prior scale matrix of inverse-Wishart distribution:
\Psi_0
- prior_shape
Prior shape of inverse-Wishart distribution:
\nu_0
- HARtrans
VHAR linear transformation matrix:
C_{HAR}
- y0
Y_0
- design
X_0
- y
Raw input (
matrix
)
It is also normaliw
and bvharmod
class.
References
Kim, Y. G., and Baek, C. (2023). Bayesian vector heterogeneous autoregressive modeling. Journal of Statistical Computation and Simulation.
See Also
-
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 -
predict.bvharmn()
to forecast the BVHAR process
Examples
# 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))