Definition
The continuous ranked probability score compares the forecast cumulative distribution F with the step function that jumps at the observed value y. Matheson and Winkler introduced it in 1976, and Gneiting and Raftery showed that it is a strictly proper scoring rule: the expected score is best when the forecast distribution is the true one.
CRPS(F, y) = ∫ ( F(x) − 1{x ≥ y} )2 dx = E|X − y| − ½ E|X − X′|
In the second form, X and X′ are two independent draws from the forecast. The first term rewards being close to the outcome, the second removes the spread the forecast admitted to. The CRPS is also twice the pinball loss averaged over all probability levels.
Worked example
Three forecasters describe the same quantity, whose true distribution is normal with mean 10 and standard deviation 2. Each provides 400 samples.
import numpy as np
rng = np.random.default_rng(3)
truth = rng.normal(10, 2, size=2_000)
def crps_samples(sample, y):
a = np.mean(np.abs(sample - y))
b = 0.5 * np.mean(np.abs(sample[:, None] - sample[None, :]))
return a - b
forecasts = {
"right distribution N(10, 2)": rng.normal(10, 2, 400),
"overconfident N(10, 0.5)": rng.normal(10, 0.5, 400),
"too wide N(10, 6)": rng.normal(10, 6, 400),
"biased N(12, 2)": rng.normal(12, 2, 400),
}
for name, s in forecasts.items():
print(f"{name:30s} mean CRPS = {np.mean([crps_samples(s, y) for y in truth]):.3f}")Output, produced by running the code above when this page was built:
right distribution N(10, 2) mean CRPS = 1.122 overconfident N(10, 0.5) mean CRPS = 1.352 too wide N(10, 6) mean CRPS = 1.745 biased N(12, 2) mean CRPS = 1.587
The forecast with the true distribution has the lowest score. Being too narrow, too wide or shifted each costs something, in the units of the variable.
Where it misleads
- The CRPS is in the units of the data, so averages over series of different scales are dominated by the large ones. Scale it, or report it by group.
- Computed from samples, the second term is biased when the sample is small. Use a few hundred draws or the closed form of the distribution when it exists.
- It weights all parts of the distribution equally. A stock decision at a 99 % service level depends on the far right tail, which contributes little to the CRPS. Score that quantile directly.
In our work
We use the CRPS to compare full demand distributions, and the quantile loss at the service level the client has chosen to judge the part of the distribution that drives the order.
Service: forecasting and statistical studies Research note: intermittent demand forecasting, measured
References
- Matheson, J. E., Winkler, R. L. (1976). Scoring rules for continuous probability distributions. Management Science, 22(10), 1087-1096. doi:10.1287/mnsc.22.10.1087
- Gneiting, T., Raftery, A. E. (2007). Strictly proper scoring rules, prediction, and estimation. Journal of the American Statistical Association, 102(477), 359-378. doi:10.1198/016214506000001437
- Kolassa, S. (2016). Evaluating predictive count data distributions in retail sales forecasting. International Journal of Forecasting, 32(3), 788-803. doi:10.1016/j.ijforecast.2015.12.004