crps
crps, function
def pure crps(r: ranvar, n: number): number
def pure crps(r1: ranvar, r2: ranvar): number
Calculates the Continuous Ranked Probability Score (CRPS) for probabilistic predictions. When called as crps(r, n)
, it computes the score between the predictive distribution r
and the observed value n
. When called as crps(r1, r2)
, it computes the extended CRPS between two predictive distributions r1
and r2
.
Examples
Example: CRPS between a ranvar and an observation
r = poisson(3)
show scalar "" with crps(r, 4)
Example: Extended CRPS between two ranvars
r1 = poisson(3)
r2 = poisson(7)
show scalar "" with crps(r1, r2)
Remarks
Let $X_1$ and $X_2$ be two random variables. Let $F_1$ and $F_2$ be the cumulative distribution functions (CDF) of $X_1$ and $X_2$ respectively. We define the CRPS between $X_1$ and $X_2$ as:
$$CRPS(X_1, X_2) = \int_{-\infty}^{+\infty} (F_1(x) - F_2(x))^2 dx$$