scoringrules.logs_mixnorm

Contents

scoringrules.logs_mixnorm#

scoringrules.logs_mixnorm(obs: ArrayLike, m: ArrayLike, s: ArrayLike, w: ArrayLike = None, mc_axis: ArrayLike = -1, *, backend: Backend = None) ArrayLike#

Compute the logarithmic score for a mixture of normal distributions.

This score is equivalent to the negative log likelihood of the normal mixture distribution

Parameters:
obsarray_like

The observed values.

marray_like

Means of the component normal distributions.

sarray_like

Standard deviations of the component normal distributions.

warray_like

Non-negative weights assigned to each component.

mc_axisint

The axis corresponding to the mixture components. Default is the last axis.

backendstr

The name of the backend used for computations. Defaults to ‘numba’ if available, else ‘numpy’.

Returns:
scorearray_like

The LS between MixNormal(m, s) and obs.

Examples

>>> import scoringrules as sr
>>> sr.logs_mixnormal(0.0, [0.1, -0.3, 1.0], [0.4, 2.1, 0.7], [0.1, 0.2, 0.7])