Last chance! 50% off unlimited learning
Sale ends in
Compute LOOIC (leave-one-out cross-validation (LOO) information criterion) and ELPD (expected log predictive density) for Bayesian regressions. For LOOIC and ELPD, smaller and larger values are respectively indicative of a better fit.
looic(model, verbose = TRUE)
A list with four elements, the ELPD, LOOIC and their standard errors.
A Bayesian regression model.
Toggle off warnings.
if (require("rstanarm")) {
model <- stan_glm(mpg ~ wt + cyl, data = mtcars, chains = 1, iter = 500, refresh = 0)
looic(model)
}
Run the code above in your browser using DataLab