score_forecasts: Score backtest forecast accuracy

View source: R/score.R

score_forecastsR Documentation

Score backtest forecast accuracy

Description

Computes standardized accuracy metrics from backtesting results.

Usage

score_forecasts(bt, metrics = c("mae", "rmse", "coverage", "wis"))

Arguments

bt

An lfq_backtest object from backtest().

metrics

Character vector of metrics to compute:

  • "mae": Mean absolute error of frequency.

  • "rmse": Root mean squared error.

  • "coverage": Proportion within prediction intervals.

  • "wis": Simplified weighted interval score for the single prediction interval stored in the backtest (typically 95%). For the full multi-quantile WIS per Bracher et al. (2021), use dedicated scoring packages such as 'scoringutils'.

Value

A tibble with columns: engine, horizon, metric, value.

References

Bracher J, Ray EL, Gneiting T, Reich NG (2021). Evaluating epidemic forecasts in an interval format. PLoS Computational Biology, 17(2):e1008618. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1371/journal.pcbi.1008618")}

See Also

compare_models() to rank engines based on scores.

Examples


sim <- simulate_dynamics(n_lineages = 3,
  advantages = c("A" = 1.2, "B" = 0.8),
  n_timepoints = 20, seed = 1)
bt <- backtest(sim, engines = "mlr",
  horizons = c(7, 14), min_train = 42)
score_forecasts(bt)



lineagefreq documentation built on April 3, 2026, 9:09 a.m.