scoringrules.logs_negbinom

Contents

scoringrules.logs_negbinom#

scoringrules.logs_negbinom(obs: ArrayLike, n: ArrayLike, prob: ArrayLike | None = None, *, mu: ArrayLike | None = None, backend: Backend = None) ArrayLike#

Compute the logarithmic score (LS) for the negative binomial distribution.

This score is equivalent to the negative log likelihood of the negative binomial distribution.

Parameters:
obsarray_like

The observed values.

narray_like

Size parameter of the forecast negative binomial distribution.

probarray_like

Probability parameter of the forecast negative binomial distribution.

muarray_like

Mean of the forecast negative binomial distribution.

Returns:
scorearray_like

The LS between NegBinomial(n, prob) and obs.

Raises:
ValueError

If both prob and mu are provided, or if neither is provided.

Examples

>>> import scoringrules as sr
>>> sr.logs_negbinom(2, 5, 0.5)