scoringrules.logs_gamma#
- scoringrules.logs_gamma(obs: ArrayLike, shape: ArrayLike, rate: ArrayLike | None = None, *, scale: ArrayLike | None = None, backend: Backend = None) ArrayLike#
Compute the logarithmic score (LS) for the gamma distribution.
This score is equivalent to the negative log likelihood of the gamma distribution
- Parameters:
- obsarray_like
The observed values.
- shapearray_like
Shape parameter of the forecast gamma distribution.
- ratearray_like
Rate parameter of the forecast gamma distribution.
- scalearray_like
Scale parameter of the forecast gamma distribution, where scale = 1 / rate.
- Returns:
- scorearray_like
The LS between obs and Gamma(shape, rate).
- Raises:
- ValueError
If both rate and scale are provided, or if neither is provided.
Examples
>>> import scoringrules as sr >>> sr.logs_gamma(0.2, 1.1, 0.1)