This function fits BVAR(p) with flat prior.
bvar_flat(
y,
p,
num_chains = 1,
num_iter = 1000,
num_burn = floor(num_iter/2),
thinning = 1,
bayes_spec = set_bvar_flat(),
include_mean = TRUE,
verbose = FALSE,
num_thread = 1
)# S3 method for bvarflat
print(x, digits = max(3L, getOption("digits") - 3L), ...)
# S3 method for bvarflat
logLik(object, ...)
# S3 method for bvarflat
AIC(object, ...)
# S3 method for bvarflat
BIC(object, ...)
is.bvarflat(x)
# S3 method for bvarflat
knit_print(x, ...)
bvar_flat()
returns an object bvarflat
class. It is a list with the following components:
Posterior Mean matrix of Matrix Normal distribution
Fitted values
Residuals
Posterior precision matrix of Matrix Normal distribution
Posterior scale matrix of posterior inverse-wishart distribution
Posterior shape of inverse-wishart distribution
Numer of Coefficients: mp + 1 or mp
Lag of VAR
Dimension of the time series
Sample size used when training = totobs
- p
Total number of the observation
Process string in the bayes_spec
: BVAR_Flat
Model specification (bvharspec
)
include constant term (const
) or not (none
)
Matched call
Prior mean matrix of Matrix Normal distribution: zero matrix
Prior precision matrix of Matrix Normal distribution: \(U^{-1}\)
\(Y_0\)
\(X_0\)
Raw input (matrix
)
Time series data of which columns indicate the variables
VAR lag
Number of MCMC chains
MCMC iteration number
Number of burn-in (warm-up). Half of the iteration is the default choice.
Thinning every thinning-th iteration
A BVAR model specification by set_bvar_flat()
.
Add constant term (Default: TRUE
) or not (FALSE
)
Print the progress bar in the console. By default, FALSE
.
Number of threads
Any object
digit option to print
not used
A bvarflat
object
Ghosh et al. (2018) gives flat prior for residual matrix in BVAR.
Under this setting, there are many models such as hierarchical or non-hierarchical. This function chooses the most simple non-hierarchical matrix normal prior in Section 3.1.
$$A \mid \Sigma_e \sim MN(0, U^{-1}, \Sigma_e)$$ where U: precision matrix (MN: matrix normal). $$p (\Sigma_e) \propto 1$$
Ghosh, S., Khare, K., & Michailidis, G. (2018). High-Dimensional Posterior Consistency in Bayesian Vector Autoregressive Models. Journal of the American Statistical Association, 114(526).
Litterman, R. B. (1986). Forecasting with Bayesian Vector Autoregressions: Five Years of Experience. Journal of Business & Economic Statistics, 4(1), 25.
set_bvar_flat()
to specify the hyperparameters of BVAR flat prior.
coef.bvarflat()
, residuals.bvarflat()
, and fitted.bvarflat()
predict.bvarflat()
to forecast the BVHAR process