loo()

Contents

loo()#

liesel.goose.loo(lpp, samples, reff=None, scale='log')[source]#

Compute Pareto-smoothed importance sampling leave-one-out cross-validation (PSIS-LOO-CV) statistic via ArviZ.

Parameters:
  • lpp (dict[str, Array | ndarray | bool | number | bool | int | float | complex | TypedNdArray] | Array | ndarray | bool | number | bool | int | float | complex | TypedNdArray) – Dictionary or array of pointwise log probability evaluations. If passed as a dictionary, each value is expected to have shape (nsamples, nchains, ...). If passed as an array, it is assumed to have shape (nsamples, nchains, n).

  • samples (dict[str, Array | ndarray | bool | number | bool | int | float | complex | TypedNdArray] | None) – Dictionary of samples at which to evaluate log probs. If samples contains entries for weak variables or for nodes in model_nodes they are ignored.

  • newdata – Dictionary of new data at which to evaluate log probs. The keys should correspond to variable or node names in the model whose values should be set to the given values before evaluating predictions. If None (default), the current variable values are used.

  • 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 samples by default.

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

ELPDData

References