Compute the empirical Continuous Ranked Probability Score (CRPS)
Description
Computes the CRPS for a single observation given a set of posterior predictive draws, using the empirical (energy form) estimator c(“\\mathrm{CRPS} = \\frac{1}{n} \\sum_{i=1}^n |x_i - y| -\n”, “\\frac{1}{2n^2} \\sum_{i=1}^n \\sum_{j=1}^n |x_i - x_j|”)
where y is the observed value and x_1, \dots, x_n are the posterior predictive draws. Missing draws in pred_pdd are dropped before computation.
crps_empirical(y, pred_pdd)Arguments
y: A single numeric observed value. ReturnsNA_real_if missing.pred_pdd: A numeric vector of posterior predictive draws for the observation. ReturnsNA_real_if empty or all missing.
Returns
A single numeric CRPS value (or NA_real_, see above).
References
Gneiting, T. and Raftery, A. E. (2007). Strictly Proper Scoring Rules, Prediction, and Estimation. Journal of the American Statistical Association, 102(477), 359-378. (Defines the energy-form representation of the CRPS used here, their eq. 21.)
Zamo, M. and Naveau, P. (2018). Estimation of the Continuous Ranked Probability Score with Limited Information and Applications to Ensemble Weather Forecasts. Mathematical Geosciences, 50(2), 209-234. (Calls this the “NRG” estimator, dividing the pairwise term by n^2
rather than n(n-1); see that paper for the alternative, less biased “fair”/PWM estimator.)