Skip to contents

Make head to head CRPS distribution comparison plot for a single location

Usage

plot_rel_crps_by_horizon(
  scores,
  loc_to_plot,
  baseline = "cfa-hosponlyrenewal(retro)",
  horizons_to_show = c("nowcast", "1 wk", "4 wks", "overall")
)

Arguments

scores

A tibble of scores by location, forecast date, date and model, containing the outputs of scoringutils::score() on samples plus metadata transformed into a tibble.

loc_to_plot

A string indicating the location to plot, as a two-letter USPS abbreviation.

baseline

Name of the model to use as a baseline. Default "cfa-hosponlyrenewal(retro)"

horizons_to_show

A vector of strings indicating the names of the horizon that we want to show on the plot, must be a subset of nowcast, 1 wk, 2 wks,3 wks, 4 wks and overall

Value

a ggplot object containing violin plots comparing the distribution of crps across forecast dates for a single location, grouped by horizon and colored by model