arviz_stats.base.array_stats.loo_expectation

arviz_stats.base.array_stats.loo_expectation#

array_stats.loo_expectation(ary, log_weights, kind='mean', chain_axis=-2, draw_axis=-1)#

Compute weighted expectation with PSIS-LOO-CV weights.

Parameters:
aryarray_like

Posterior predictive samples.

log_weightsarray_like

Pre-computed PSIS log weights.

kindstr, default “mean”

Type of expectation: “mean”, “median”, “var”, “sd”, “circular_mean”, “circular_var”, “circular_sd”.

chain_axisint, default -2

Axis for chains.

draw_axisint, default -1

Axis for draws.

Returns:
expectationarray_like

Weighted expectation values.