scoringrules.crps_lognormal

Contents

scoringrules.crps_lognormal#

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

Compute the closed form of the CRPS for the lognormal distribution.

It is based on the formulation introduced by [1]:

\[\mathrm{CRPS}(\mathrm{log}\mathcal{N}(\mu, \sigma), y) = y [2 \Phi(y) - 1] - 2 \mathrm{exp}(\mu + \frac{\sigma^2}{2}) \left[ \Phi(\omega - \sigma) + \Phi(\frac{\sigma}{\sqrt{2}}) \right],\]

where \(\Phi\) is the CDF of the standard normal distribution and \(\omega = \frac{\mathrm{log}y - \mu}{\sigma}\).

Note that mean and standard deviation are not the values for the distribution itself, but of the underlying normal distribution it is derived from.

Parameters:
obsarray_like

The observed values.

mulogarray_like

Mean of the normal underlying distribution.

sigmalogarray_like

Standard deviation of the underlying normal distribution.

Returns:
crpsarray_like

The CRPS between Lognormal(mu, sigma) and obs.

References

[1]

Baran, S. and Lerch, S. (2015), Log-normal distribution based Ensemble Model Output Statistics models for probabilistic wind-speed forecasting. Q.J.R. Meteorol. Soc., 141: 2289-2299. https://doi.org/10.1002/qj.2521

Examples

>>> import scoringrules as sr
>>> sr.crps_lognormal(0.1, 0.4, 0.0)
1.3918246976412703