LOOResult

Result of PSIS-LOO cross-validation on a fitted GAM.

Usage

Source

LOOResult(
    elpd_loo,
    se_elpd_loo,
    p_loo,
    pointwise,
    pareto_k,
    n_bad_k,
)

Attributes

elpd_loo: float

Expected log predictive density (ELPD_LOO), summed over observations. Higher is better.

se_elpd_loo: float

Approximate standard error of elpd_loo, computed as sqrt(n * var(pointwise)).

p_loo: float

Effective number of parameters (LOO penalty). Computed as lpd_full - elpd_loo where lpd_full is the log-likelihood at the posterior mean. Large p_loo relative to the actual parameter count suggests model misspecification.

pointwise: NDArray

Per-observation LOO log predictive density values, shape (n,).

pareto_k: NDArray

Per-observation Pareto k diagnostic, shape (n,). Values above 0.7 indicate that the PSIS approximation is unreliable for that observation; values above 1.0 indicate the importance weights have infinite variance and LOO is invalid.

n_bad_k: int
Number of observations with pareto_k > 0.7.