scoringrules.crps_cnormal

Contents

scoringrules.crps_cnormal#

scoringrules.crps_cnormal(obs: ArrayLike, location: ArrayLike, scale: ArrayLike, lower: ArrayLike = -inf, upper: ArrayLike = inf, *, backend: Backend = None) ArrayLike#

Compute the closed form of the CRPS for the censored normal distribution.

It is based on the formulation for the generalised truncated and censored normal distribution with lmass and umass set to the tail probabilities of the predictive distribution.

Parameters:
obsarray_like

The observed values.

locationarray_like

Location parameter of the forecast distribution.

scalearray_like

Scale parameter of the forecast distribution.

lowerarray_like

Lower boundary of the truncated forecast distribution.

upperarray_like

Upper boundary of the truncated forecast distribution.

Returns:
crpsarray_like

The CRPS between cNormal(location, scale, lower, upper) and obs.

Examples

>>> import scoringrules as sr
>>> sr.crps_cnormal(0.0, 0.1, 0.4, -1.0, 1.0)
0.10338851213123085