Description Usage Arguments Value Author(s) References Examples
View source: R/eval_forecasts_continuous_integer.R
Evaluate forecasts in a Sample-Based Format (Integer or Cotinuous)
1 2 3 4 5 6 7 8 9 10 11 12 | eval_forecasts_sample(
data,
by,
summarise_by,
metrics,
prediction_type,
quantiles,
sd,
pit_plots,
summarised,
verbose
)
|
data |
A data.frame or data.table with the predictions and observations. Note: it is easiest to have a look at the example files provided in the package and in the examples below. The following columns need to be present:
For integer and continuous forecasts a
For quantile forecasts the data can be provided in variety of formats. You
can either use a range-based format or a quantile-based format. (You can
convert between formats using
For a range format (long) forecast you need
Alternatively you can also provide the format in a wide range format. This format needs
|
by |
character vector of columns to group scoring by. This should be the
lowest level of grouping possible, i.e. the unit of the individual
observation. This is important as many functions work on individual
observations. If you want a different level of aggregation, you should use
|
summarise_by |
character vector of columns to group the summary by. By
default, this is equal to 'by' and no summary takes place.
But sometimes you may want to to summarise
over categories different from the scoring.
|
metrics |
the metrics you want to have in the output. If 'NULL' (the default), all available metrics will be computed. |
prediction_type |
character, should be either "continuous" or "integer" |
quantiles |
numeric vector of quantiles to be returned when summarising. Instead of just returning a mean, quantiles will be returned for the groups specified through 'summarise_by'. By default, no quantiles are returned. |
sd |
if TRUE (the default is FALSE) the standard deviation of all metrics will be returned when summarising. |
pit_plots |
if TRUE (not the default), pit plots will be returned. For
details see |
summarised |
Summarise arguments (i.e. take the mean per group specified in group_by. Default is TRUE. |
verbose |
print out additional helpful messages (default is TRUE) |
A data.table with appropriate scores. For more information see
eval_forecasts
Nikos Bosse nikosbosse@gmail.com
Funk S, Camacho A, Kucharski AJ, Lowe R, Eggo RM, Edmunds WJ (2019) Assessing the performance of real-time epidemic forecasts: A case study of Ebola in the Western Area region of Sierra Leone, 2014-15. PLoS Comput Biol 15(2): e1006785. https://doi.org/10.1371/journal.pcbi.1006785
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | ## Integer Forecasts
integer_example <- data.table::setDT(scoringutils2::integer_example_data)
eval <- scoringutils2::eval_forecasts(integer_example,
summarise_by = c("model"),
quantiles = c(0.1, 0.9),
sd = TRUE,
pit_plots = TRUE)
eval <- scoringutils2::eval_forecasts(integer_example)
## Continuous Forecasts
continuous_example <- data.table::setDT(scoringutils2::continuous_example_data)
eval <- scoringutils2::eval_forecasts(continuous_example)#'
eval <- scoringutils2::eval_forecasts(continuous_example,
quantiles = c(0.5, 0.9),
sd = TRUE,
summarise_by = c("model"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.