loo()

Contents

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, pass 1.0.

  • scale (Literal['log', 'negative_log', 'deviance'], default: 'log') –

    Output scale. The options are:

    • log: (default) log probability scale.

    • negative_log: -1 * log

    • deviance: -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