scoringrules.crps_t

Contents

scoringrules.crps_t#

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

Compute the closed form of the CRPS for the student’s t distribution.

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

\[\mathrm{CRPS}(F, y) = \sigma \left\{ \omega (2 F_{\nu} (\omega) - 1) + 2 f_{\nu} \left( \frac{\nu + \omega^{2}}{\nu - 1} \right) - \frac{2 \sqrt{\nu}}{\nu - 1} \frac{B(\frac{1}{2}, \nu - \frac{1}{2})}{B(\frac{1}{2}, \frac{\nu}{2}^{2})} \right\},\]

where \(\omega = (y - \mu)/\sigma\), where \(\nu > 1, \mu\), and \(\sigma > 0\) are the degrees of freedom, location, and scale parameters respectively of the Student’s t distribution, and \(f_{\nu}\) and \(F_{\nu}\) are the PDF and CDF of the standard Student’s t distribution with \(\nu\) degrees of freedom.

Parameters:
obsarray_like

The observed values.

dfarray_like

Degrees of freedom parameter of the forecast t distribution.

locationarray_like

Location parameter of the forecast t distribution.

sigmaarray_like

Scale parameter of the forecast t distribution.

Returns:
crpsarray_like

The CRPS between t(df, location, scale) and obs.

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_t(0.0, 0.1, 0.4, 0.1)
0.07687151141732129