Add the fair CRPS for sample forecasts
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
Research direction
Start by reading R/metrics-sample.R for crps_sample() and R/metrics-multivariate-sample.R for the energy score, then inspect how each builds sample matrices and handles separate_results. Add an estimator choice that preserves the current default and supports the fair formula in the issue. Done means both scores use the selected estimator, including the dispersion term when requested, with tests covering the default and fair results.
Written by the indexing model from the issue text.
Description
crps_sample() and es_sample() use the empirical estimators of scoringRules, which are biased in the ensemble size. A fair (ensemble-size-corrected) version would make scores comparable across forecasts with different numbers of samples.
What the fair CRPS is. For m samples X_1, ..., X_m and observation y, the fair CRPS is an unbiased estimator of E|X − y| − E|X − X'|/2:
(1/m) Σ_i |X_i − y| − (1/(2m(m−1))) Σ_{i≠j} |X_i − X_j|
The usual estimator divides the second sum by 2m², which biases the score by an amount of order 1/m, so small ensembles score worse than large ones.
The fair energy score is the same with the norm ‖·‖ in place of |·|.
Why it matters. Hub ensembles, and our own model draws, come with different numbers of samples (for example 100 and 1000).
With the usual estimator the score depends on that number, so models are not compared on the same footing unless the samples are subsampled to a common size.
What exists.
- scoringutils (current main,
R/metrics-sample.R):crps_sample()passes...toscoringRules::crps_sample()and has no fair estimator.R/metrics-multivariate-sample.RcallsscoringRules::es_sample(). NEWS has no mention of a fair score, and a search of open and closed issues for "fair crps" and "ensemble size" finds nothing. - scoringRules 1.1.3:
crps_sample(y, dat, method = "edf", w, bw, num_int, show_messages)offersedfandkdeonly, andes_sample(y, dat, w)has no option, so there is nothing for scoringutils to pass through. - Python
scoringrules:crps_ensemble(..., estimator="fair")gives the fair CRPS (other estimators includenrg,pwm,int).
Suggested API. Add an estimator argument to crps_sample(), with the current scoringRules behaviour as the default so nothing changes (for example estimator = c("default", "fair")), and the same for the multivariate energy score.
separate_results = TRUE would use the chosen estimator for the dispersion term too.
The fair estimator is a few lines of vectorised R on the sample matrix, so it need not wait for scoringRules.
References.
- Ferro, C. A. T. (2014). Fair scores for ensemble forecasts. Quarterly Journal of the Royal Meteorological Society, 140, 1917-1923. doi:10.1002/qj.2270
- 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, 209-234. doi:10.1007/s11004-017-9709-7
This was opened by a bot. Please ping @seabbs for any questions.
- Dominant language
- R
- Stars
- 67
- Forks
- 24
- Avg merge
- 1h 24m
- Merged PRs (30d)
- 2
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from epiforecasts/scoringutils
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
epiforecasts/scoringutils#1264 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
epiforecasts/scoringutils#1265 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
epiforecasts/scoringutils#1260 ·
Maintainers usually reply within 1 day
-
Incorrect guidance in `NEWS.md` re `add_relative_skill()`?Possibly taken @nikosbosse claimed this 15 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
epiforecasts/scoringutils#1226 · 1 comment · 2 reactions ·
Maintainers usually reply within 1 day
-
get_pit_histogram(): unsorted breaks produce negative densities; num_bins = 1 returns an empty tablePossibly taken @nikosbosse claimed this 15 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
epiforecasts/scoringutils#1219 ·
Maintainers usually reply within 1 day
All issues in epiforecasts/scoringutils
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
leppott/BioMonTools#162 ·
-
publications
Difficulty 1/5 Under an hour Newbie friendliness 85/100
epiforecasts/epiforecasts.github.io#161 ·
Maintainers usually reply within 1 day
-
Label `{sas}` chunk source as `sas` instead of `txt`, so it gets syntax highlightingPossibly taken @michaelmayer2 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
microbiome/OMA#1031 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
ThinkR-open/golem#1265 ·