Learn R Programming

scoringutils (version 0.1.4)

wis_components: Plot Contributions to the Weighted Interval Score

Description

Visualise the components of the weighted interval score: penalties for over-predicition, under-prediction and for a lack of sharpness

Usage

wis_components(
  scores,
  x = "model",
  group = NULL,
  relative_contributions = FALSE,
  facet_formula = NULL,
  scales = "free_y",
  nrow = NULL,
  xlab = x,
  ylab = "WIS contributions"
)

Arguments

scores

A data.frame of scores based on quantile forecasts as produced by eval_forecasts

x

The variable from the scores you want to show on the x-Axis. Usually this will be "model"

group

Choose a grouping variable for the plot that gets directly passed down to ggplot. Default is NULL

relative_contributions

show relative contributions instead of absolute contributions. Default is FALSE and this functionality is not available yet.

facet_formula

facetting formula passed down to ggplot. Default is NULL

scales

scales argument that gets passed down to ggplot. Only necessary if you make use of facetting. Default is "free_y"

nrow

nrow argument that gets passed down to ggplot. Specifies the number of rows to use for facet_wrap in ggplot

xlab

Label for the x-axis. Default is the variable name on the x-axis

ylab

Label for the y-axis. Default is "WIS contributions"

Value

A ggplot2 object showing a contributions from the three components of the weighted interval score

References

Bracher J, Ray E, Gneiting T, Reich, N (2020) Evaluating epidemic forecasts in an interval format. https://arxiv.org/abs/2005.12881

Examples

Run this code
# NOT RUN {
scores <- scoringutils::eval_forecasts(scoringutils::quantile_example_data_wide,
                                       by = c("model", "id", "horizon"),
                                       summarise_by = c("model", "horizon"))
scoringutils::wis_components(scores, x = "model", facet_formula = ~ horizon)

# }

Run the code above in your browser using DataLab