Closed Bisaloo closed 3 years ago
Thank you for pointing this out! I addressed this issue via https://github.com/epiforecasts/scoringutils/pull/112
One small note: the correct syntax for what you were trying to achieve is this
range_example_wide <- data.table::setDT(scoringutils::range_example_data_wide)
range_example <- scoringutils::range_wide_to_long(range_example_wide)
eval <- scoringutils::eval_forecasts(range_example,
summarise_by = c("model", "range"),
metrics = "coverage",
sd = TRUE)
which gives you one score for every range and then you need to filter for the desired ranges. The reason is that scoringutils gives you everything in a long format (which admittedly is maybe slightly confusing). The quantiles option you had selected would give you the quantiles of the score as a summary measure (so e.g. if you had 100 scores for every model, specifying quantiles would give you the desired quantiles in addition to the mean that is returned per default)
Addressed via #112. Thanks a lot!
Here is a reproducible example:
Created on 2021-07-08 by the reprex package (v2.0.0.9000)
This happens because the code to compute coverage assumes that a
res
object already exists:https://github.com/epiforecasts/scoringutils/blob/8437a562002270fb9cd957c8cc801a27a46a0787/R/eval_forecasts_quantile.R#L79-L82
but this is only the case if
interval_score
is listed inmetrics
and this code has run before:https://github.com/epiforecasts/scoringutils/blob/8437a562002270fb9cd957c8cc801a27a46a0787/R/eval_forecasts_quantile.R#L56-L76
There is the same issue with
metrics = "coverage"
for example.Related: #77
I can submit a PR to fix this if you want but feel free to fix it directly if it's simpler for you.