Computes WAIC for a map2stan
model fit.
WAIC( object , n=1000 , refresh=0.1 , ... )
Object of class map2stan
Number of samples to use in computing WAIC. Set to n=0
to use all samples in map2stan
fit
Refresh interval for progress display. Set to refresh=0
to suppress display.
Other parameters to pass to someone
This function uses the samples and model definition from a map2stan
fit to compute the Widely Applicable Information Criterion, WAIC. WAIC is an estimate of out-of-sample relative K-L divergence, and it is defined as:
$$WAIC = -2(lppd - pWAIC)$$
Components lppd
(log pointwise predictive density) and pWAIC
(the effective number of parameters) are reported as attributes. See Gelman et al 2013 for definitions and formulas. This function uses the variance definition for pWAIC
.
The function link
is used internally the compute the values of any linear models.
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.
Gelman, A., J. Hwang, and A. Vehtari. 2013. Understanding predictive information criteria for Bayesian models.