Reference / binference.diagnostics.psis

binference.diagnostics.psis

binference.diagnostics.psis(log_weights)[source]

Pareto-smoothed importance sampling.

Parameters:
log_weightsarray_like (n,)

Unnormalised log importance ratios, at least PSIS_MIN_WEIGHTS of them; -inf and NaN get zero weight, and +inf is refused.

Returns:
log_weights_smoothed(n,) array

Normalised (logsumexp == 0) smoothed log-weights.

k_hatfloat

Estimated Pareto shape: the estimate is reliable below psis_threshold() of the number of weights (0.7 from about 2,000); -inf for equal weights, which have no tail; inf when the tail cannot be fitted (see PSIS_MIN_WEIGHTS), and then the weights are not smoothed.