WAIC.bvar | R Documentation |
Calculates the widely applicable (or Watanabe-Akaike) information criterion
(Watanabe, 2010) for VAR models generated with bvar
. The
result equals
-2 (\text{lppd} - \text{pWAIC}
, where 'lppd' is the log pointwise predictive density, and 'pWAIC' is the effective number of parameters.
## S3 method for class 'bvar'
WAIC(x, n_thin = 1L, ...)
WAIC(x, ...)
## Default S3 method:
WAIC(x, ...)
x |
A |
n_thin |
Integer scalar. Every n_thin'th draw in x is used to calculate, others are dropped. |
... |
Not used. |
Returns a numerical value.
Watanabe, S. (2010) Asymptotic Equivalence of Bayes Cross Validation and Widely Applicable Information Criterion in Singular Learning Theory. Journal of Machine Learning Research, 11, 3571-3594.
Kuschnig, N. and Vashold, L. (2021) BVAR: Bayesian Vector Autoregressions with Hierarchical Prior Selection in R. Journal of Statistical Software, 14, 1-27, \Sexpr[results=rd]{tools:::Rd_expr_doi("10.18637/jss.v100.i14")}.
bvar
# Access a subset of the fred_qd dataset
data <- fred_qd[, c("CPIAUCSL", "UNRATE", "FEDFUNDS")]
# Transform it to be stationary
data <- fred_transform(data, codes = c(5, 5, 1), lag = 4)
# Estimate a BVAR using one lag, default settings and very few draws
x <- bvar(data, lags = 1, n_draw = 600L, n_burn = 100L, verbose = FALSE)
# Calculate the log-likelihood
WAIC(x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.