Skip to contents

Plot a timeseries of relative scores versus time

Usage

plot_rel_score_t(
  scores,
  target_models,
  baseline_model,
  metric_to_compare,
  x = "forecast_date",
  by = NULL,
  retain_baseline = FALSE,
  model_z_order = NULL
)

Arguments

scores

Output of scoringutils::score(), not yet summarized.

target_models

Model for which to plot relative scores

baseline_model

Baseline model for the relative scores computation.

metric_to_compare

Metric for which to plot relative scores. One of "wis" or "crps". Not case-sensitive.

x

Name of the column defining the x axis (typically time) Default "forecast_date".

by

additional variables defining a single score to plot. Passed along with the variable defined by x as the by argument to forecasttools::summarise_scores_with_baseline(). Default NULL (do not summarize over additional variables).

retain_baseline

Retain the baseline model (with its relative scores of 1) alongside the target models(s)? Default FALSE.

model_z_order

z-order in which to overplot the individual models, ascending (so the last named model is plotted on top). If NULL (default), plot the the models in order of overall score, so that the lowest (best) scoring models are on top.

Value

a ggplot object with the distributions plotted by forecast date.