Widely Application Information Criteria (WAIC) for model comparison

waic(fit, pointwise = FALSE, digits = 2)

Source

Watanabe, S. (2010). Asymptotic equivalence of Bayes cross validation and widely application information criterion in singular learning theory. Journal of Machine Learning Research 11, 3571-3594.

Arguments

fit

An geostan_fit object or any Stan model with a parameter named "log_lik", the pointwise log likelihood of the observations.

pointwise

Logical (defaults to FALSE), should a vector of values for each observation be returned?

digits

Round results to this many digits.

Value

A vector of length 3 with WAIC, a rough measure of the effective number of parameters estimated by the model Eff_pars, and log predictive density Lpd. If pointwise = TRUE, results are returned in a data.frame.

Examples

data(georgia)
fit <- stan_glm(log(rate.male) ~ 1, data = georgia,
                chains = 2, iter = 800) # for speed only
waic(fit)