loo()#
- liesel.goose.loo(lpp, samples=None, reff=None, scale='log')[source]#
Compute Pareto-smoothed importance sampling leave-one-out cross-validation (PSIS-LOO-CV) statistic via ArviZ.
- Parameters:
lpp (
Mapping[str,Array|ndarray|bool|number|bool|int|float|complex] |Array|ndarray|bool|number|bool|int|float|complex) – Dictionary or array of pointwise log probability evaluations. If passed as a dictionary, each value is expected to have shape(nchains, ndraws, ...). If passed as an array, it is assumed to have shape(nchains, ndraws, n).samples (
dict[str,Array|ndarray|bool|number|bool|int|float|complex] |None, default:None) – Retained for backwards compatibility and ignored.reff (
float|None, default:None) – Relative MCMC efficiency, ess / n i.e. number of effective samples divided by the number of actual samples. Computed from the likelihood values by default. For independent draws, pass1.0.scale (
Literal['log','negative_log','deviance'], default:'log') –Output scale. The options are:
log: (default) log probability scale.negative_log:-1 * logdeviance:-2 * log
A higher log probability (or a lower deviance or negative log_score) indicates a model with better predictive accuracy.
- Return type:
_LieselELPDData
References
Computations are carried out via ArviZ: https://python.arviz.org/en/stable/
Theoretical background: Vehtari, A., Gelman, A., & Gabry, J. (2017). Practical Bayesian model evaluation using leave-one-out cross-validation and WAIC. Statistics and Computing, 27(5), 1413–1432. https://doi.org/10.1007/s11222-016-9696-4