models.elpd_loo()

Leave-one-out cross-validation by Pareto-smoothed importance sampling

Usage

models.elpd_loo(
    log_lik,
    r_eff=None,
)

(PSIS-LOO), from one fit’s pointwise log-likelihood draws. Matches the R package loo.

Parameters

log_lik: list of list of float

One row per posterior draw, one column per observation: log p(y_i | theta_s).

r_eff: list of float = None
Relative efficiency of the draws per observation (1 for independent draws).

Returns

Elpd
With pareto_k and k_threshold.