compute_forecast_bias: Signed forecast error (bias)

View source: R/bias_drift.R

compute_forecast_biasR Documentation

Signed forecast error (bias)

Description

MASE/sMAPE/RMSE are all magnitude-only, so a model that's consistently over- or under-forecasting can still look "fine" on those alone. This surfaces the signed error directly. Generic across every registered model – only needs fc_tib's ds/yhat and test_df's ds/y.

Usage

compute_forecast_bias(fc_tib, test_df)

Arguments

fc_tib

A tibble with ds/yhat columns – a model's forecast.

test_df

A tibble with ds/y columns – the held-out actuals.

Value

A list with bias (mean signed error, y - yhat), pct_bias (bias as a percentage of mean ⁠|y|⁠), and n. All NA/0 if there's no overlap.

Examples

ds <- as.Date("2024-01-01") + 0:4
fc_tib <- tibble::tibble(ds = ds, yhat = rep(8, 5))
test_df <- tibble::tibble(ds = ds, y = rep(10, 5))
compute_forecast_bias(fc_tib, test_df)

forecastsuite documentation built on Oct. 18, 2026, 5:08 p.m.