Skip to contents

CRPS compares a predictive distribution with an observation; lower values are better. Supply either equally weighted predictive samples in distribution, or a normal predictive distribution through pred and predictive_sd.

Usage

crps(obs, distribution = NULL, pred = NULL, predictive_sd = NULL, na.rm = TRUE)

Arguments

obs

Numeric observation vector.

distribution

Numeric matrix/data frame of equally weighted predictive samples, one row per observation.

pred, predictive_sd

Mean and strictly positive predictive SD for normal predictive distributions.

na.rm

Logical; remove incomplete observation/distribution rows?

Value

One numeric mean CRPS value.

Details

$$\mathrm{CRPS}(F, obs) = \int_{-\infty}^{\infty} [F(z)-I(z\geq obs)]^2\,dz$$

CRPS has response units and lower values are better; zero is ideal. It is a proper scoring rule that jointly rewards calibrated and sharp distributions.

References

Hersbach, H. (2000). Decomposition of the continuous ranked probability score for ensemble prediction systems. Weather and Forecasting, 15, 559-570. doi:10.1175/1520-0434(2000)015%3C0559:DOTCRP%3E2.0.CO;2

Examples

crps(0, distribution = matrix(c(-1, 1), nrow = 1))
#> [1] 0.5