Skip to contents

Watanabe-Akaike Information Criterion (Watanabe 2010) based on the pointwise log-likelihoods. WAIC is asymptotically equivalent to LOO-CV; prefer calculate_loo() when Pareto-k is well-behaved.

Usage

calculate_waic(
  object,
  survival_unit = c("observation", "arm", "aggregate"),
  ...
)

Arguments

object

An mlumr_fit object.

survival_unit

For survival fits, the WAIC pointwise unit: "observation" (default), "arm", or "aggregate" (see calculate_loo() for details). Ignored for non-survival families.

...

Further arguments passed to loo::waic().

Value

An object of class waic (see loo::waic()).

Note

As with calculate_loo(), each AgD row is treated as an independent observation. WAIC will be optimistic for AgD rows that share a study (see the note on calculate_loo()). For survival fits the AgD pointwise unit is a reconstructed pseudo-individual, so WAIC is at the pseudo-individual level (see the survival note on calculate_loo()).

Examples

if (FALSE) { # \dontrun{
waic_spfa <- calculate_waic(fit_spfa)
} # }