scoringrules.logs_hypergeometric

scoringrules.logs_hypergeometric#

scoringrules.logs_hypergeometric(obs: ArrayLike, m: ArrayLike, n: ArrayLike, k: ArrayLike, *, backend: Backend = None) ArrayLike#

Compute the logarithmic score (LS) for the hypergeometric distribution.

This score is equivalent to the negative log likelihood of the hypergeometric distribution

Parameters:
obsarray_like

The observed values.

marray_like

Number of success states in the population.

narray_like

Number of failure states in the population.

karray_like

Number of draws, without replacement. Must be in 0, 1, …, m + n.

backendstr

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

Returns:
scorearray_like

The LS between obs and Hypergeometric(m, n, k).

Examples

>>> import scoringrules as sr
>>> sr.logs_hypergeometric(5, 7, 13, 12)