scoringrules.crps_loglogistic

scoringrules.crps_loglogistic#

scoringrules.crps_loglogistic(obs: ArrayLike, mulog: ArrayLike, sigmalog: ArrayLike, backend: Backend = None) ArrayLike#

Compute the closed form of the CRPS for the log-logistic distribution.

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

\[\begin{split}\text{CRPS}(y, F_{\mu,\sigma}) = y \left( 2F_{\mu,\sigma}(y) - 1 \right) - 2 \exp(\mu) I\left(F_{\mu,\sigma}(y); 1 + \sigma, 1 - \sigma\right) \\ + \exp(\mu)(1 - \sigma) B(1 + \sigma, 1 - \sigma)\end{split}\]

where ( F_{mu,sigma}(x) ) is the cumulative distribution function (CDF) of the log-logistic distribution, defined as:

\[\begin{split}F_{\mu,\sigma}(x) = \begin{cases} 0, & x \leq 0 \\ \left( 1 + \exp\left(-\frac{\log x - \mu}{\sigma}\right) \right)^{-1}, & x > 0 \end{cases}\end{split}\]

\(B\) is the beta function, and \(I\) is the regularised incomplete beta function.

Parameters:
obsarray_like

The observed values.

mulogarray_like

Location parameter of the log-logistic distribution.

sigmalogarray_like

Scale parameter of the log-logistic 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 Loglogis(mulog, sigmalog).

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_loglogistic(3.0, 0.1, 0.9)
1.1329527730161177