scoringrules.crps_exponentialM

scoringrules.crps_exponentialM#

scoringrules.crps_exponentialM(obs: ArrayLike, mass: ArrayLike = 0.0, location: ArrayLike = 0.0, scale: ArrayLike = 1.0, *, backend: Backend = None) ArrayLike#

Compute the closed form of the CRPS for the standard exponential distribution with a point mass at the boundary.

It is based on the following formulation from [1]:

\[\mathrm{CRPS}(F_{M}, y) = |y| - 2 (1 - M) F(y) + \frac{(1 - M)**2}{2},\]
\[\mathrm{CRPS}(F_{M, \mu, \sigma}, y) = \sigma \mathrm{CRPS} \left( F_{M}, \frac{y - \mu}{\sigma} \right),\]

where \(F_{M, \mu, \sigma}\) is standard exponential distribution function generalised using a location parameter \(\mu\) and scale parameter \(\sigma < 0\) and a point mass \(M \in [0, 1]\) at \(\mu\), \(F_{M} = F_{M, 0, 1}\), and

\[F(y) = 1 - \exp(-y)\]

for \(y \geq 0\), and 0 otherwise.

Parameters:
obsarray_like

The observed values.

massarray_like

Mass parameter of the forecast exponential distribution.

locationarray_like

Location parameter of the forecast exponential distribution.

scalearray_like

Scale parameter of the forecast exponential distribution.

backendstr, optional

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

Returns:
crpsarray_like

The CRPS between obs and ExpM(mass, location, scale).

References

[1]

Jordan, A., Krüger, F., & Lerch, S. (2019). Evaluating Probabilistic Forecasts with scoringRules. Journal of Statistical Software, 90(12), 1-37. https://doi.org/10.18637/jss.v090.i12

Examples

>>> import scoringrules as sr
>>> sr.crps_exponentialM(0.4, 0.2, 0.0, 1.0)
0.19251207365702294