add_ic: Add information criteria and fit indices to fitted model objects
Description
Add information criteria and fit indices to fitted model objects
Usage
add_ic(x, ...)
add_ic(x, ...) <- value
# S3 method for brmsfit
add_ic(x, ic = "loo", ...)
Arguments
x
An R object typically of class brmsfit.
...
Further arguments passed to the underlying
functions computing the information criteria.
ic, value
Names of the information criteria / fit indices
to compute. Currently supported are "loo",
"waic", "kfold", "R2" (R-squared), and
"bridge" (log marginal likelihood).
Value
An object of the same class as x, but
with information criteria added for later usage.
# NOT RUN {fit <- brm(count ~ Trt, epilepsy, poisson())
# add both LOO and WAIC at oncefit <- add_ic(fit, ic = c("loo", "waic"))
print(fit$loo)
print(fit$waic)
# }# NOT RUN {# }