Learn R Programming

BAMBI (version 2.3.5)

loo.angmcmc: Leave-one-out cross-validation (LOO) for angmcmc objects

Description

Leave-one-out cross-validation (LOO) for angmcmc objects

Usage

# S3 method for angmcmc
loo(x, ...)

Arguments

x

angmcmc object.

...

additional model specific arguments to be passed to waic from loo. For example, int.displ specifies integer displacement in wnorm and wnorm2 models. See fit_wnormmix and fit_wnorm2mix for more details.

Details

Note that loo.angmcmc calls loo for computation. If the likelihood contribution of each data point for each MCMC iteration is available in object (can be returned by setting return_llik_contri = TRUE) during fit_angmix call), loo.array is used; otherwise loo.function is called. Computation is much faster if the likelihood contributions are available - however, they are very memory intensive, and by default not returned in fit_angmix.

Examples

Run this code
# \donttest{
# illustration only - more iterations needed for convergence
fit.vmsin.20 <- fit_vmsinmix(tim8, ncomp = 3, n.iter =  20,
                             n.chains = 1, return_llik_contri = TRUE)
library(loo)
loo(fit.vmsin.20)
# }

Run the code above in your browser using DataLab