Efficient approximate leave-one-out cross-validation using the loo package
loo.jsdmStanFit.RdThis function uses the loo package to compute PSIS-LOO CV, efficient
approximate leave-one-out (LOO) cross-validation for Bayesian models using Pareto
smoothed importance sampling (PSIS). This requires that the model was fit using
log_lik = TRUE.
Usage
# S3 method for class 'jsdmStanFit'
loo(x, calc_reff = TRUE, cores = getOption("mc.cores", 1), ...)Arguments
- x
The jsdmStanFit model object
- calc_reff
Whether to calculate the relative efficiencies for loo, by default
TRUE. If set toFALSEthen relative efficiency is assumed to be 1.- cores
The number of cores the loo functions use, by default uses the mc.cores option (or 1, if unspecified).
- ...
Other arguments passed to the
loofunction
Value
A list with class c("psis_loo","loo"), as detailed in the
loo documentation