cv_quap: Diagnostic trace and rank histogram plots for MCMC output

View source: R/zCV-methods.R

cv_quapR Documentation

Diagnostic trace and rank histogram plots for MCMC output

Description

Cross validation for quap model fits.

Usage

cv_quap( quap_model, lno = 1, pw = FALSE, cores = 1, ... )

Arguments

quap_model

quap model fit

lno

Number of observations to leave out in each fold

pw

Pointwise results (TRUE) or summed across folds (FALSE)

cores

Number of cores to use. If great than 1, uses mclappy with folds

...

Additional arguments to pass to quap

Details

This function constructs cross validation folds from an existing quap model fit and associated data. It then fits the model to each fold and returns either the fit to each fold (when pw=TRUE) or the summed performance across all folds.

The default is leave-one-out cross-validation, when lno=1.

Author(s)

Richard McElreath


rmcelreath/rethinking documentation built on Aug. 26, 2024, 5:54 p.m.