Learn R Programming

clmstan (version 0.1.1)

waic.clmstan: Widely Applicable Information Criterion for clmstan objects

Description

Computes the Widely Applicable Information Criterion (WAIC) for a fitted cumulative link model.

Usage

# S3 method for clmstan
waic(x, ...)

Value

An object of class c("waic", "loo") containing:

  • estimates: A matrix with columns Estimate and SE for elpd_waic, p_waic, and waic.

  • pointwise: A matrix with pointwise contributions.

Arguments

x

A clmstan object returned by clm_stan.

...

Additional arguments (currently ignored).

Details

WAIC is an alternative to LOO-CV that is asymptotically equivalent to leave-one-out cross-validation. However, LOO-CV with PSIS is generally preferred because:

  • It provides useful diagnostics (Pareto k values)

  • It is more robust in finite samples

  • It has been shown to be more reliable in practice

For most purposes, loo.clmstan is recommended over WAIC.

See Also

loo.clmstan for LOO-CV (recommended), waic for details on WAIC computation, loo_compare for model comparison.

Examples

Run this code
if (FALSE) {
fit <- clm_stan(rating ~ temp, data = wine)
waic_result <- waic(fit)
print(waic_result)
}

Run the code above in your browser using DataLab