bvar_flat | R Documentation |
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 class 'bvarflat'
print(x, digits = max(3L, getOption("digits") - 3L), ...)
## S3 method for class 'bvarflat'
logLik(object, ...)
## S3 method for class 'bvarflat'
AIC(object, ...)
## S3 method for class 'bvarflat'
BIC(object, ...)
is.bvarflat(x)
## S3 method for class 'bvarflat'
knit_print(x, ...)
y |
Time series data of which columns indicate the variables |
p |
VAR lag |
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 BVAR model specification by |
include_mean |
Add constant term (Default: |
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 |
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
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
)
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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.