Calculate approximate leave-one-out cross-validation (LOO-CV) for a model.
loo.StanBase.RdCalculate approximate leave-one-out cross-validation (LOO-CV) for a model.
Usage
# S3 method for class 'StanBase'
loo(x, pointwise_ll_fun, additional_args = list(), moment_match = FALSE, ...)Arguments
- x
A
StanBaseobject.- pointwise_ll_fun
Function that calculates the pointwise log-likelihood given a vector of parameter values.
- additional_args
List of additional arguments to be passed to
pointwise_ll_fun.- moment_match
(logical) Whether to use a moment-matching correction for problematic observations.
- ...
Additional arguments to be passed to
loo::loo().