Library · Metric

Forecast bias: mean error

Bias is the average of forecast minus actual. It says whether a method orders too much or too little over time, which no accuracy measure reports. A biased forecast can have the best accuracy score.

By , published

Definition

The mean error is the average signed error: it keeps the sign of each miss. Dividing the total error by the total demand gives a percentage that reads directly as stock: a bias of +10 % means the forecasts add up to 10 % more than what was sold.

bias = Σ ( ft − yt ) ÷ Σ yt × 100

Sign conventions differ between teams. Here a positive bias is an over-forecast. Whatever the convention, state it next to the number.

Worked example

Two forecasts of the same intermittent item: one always forecasts zero, one forecasts the long-run mean. The interval comes from resampling the periods.

import numpy as np

rng = np.random.default_rng(11)
demand = rng.poisson(0.4, size=240)             # about 67 % of periods are zero

def bias_pct(y, f):
    return 100 * (f - y).sum() / y.sum()

def interval(y, f, n=2000):
    idx = rng.integers(0, len(y), size=(n, len(y)))
    b = [bias_pct(y[i], f[i]) for i in idx]
    return np.percentile(b, [2.5, 97.5])

for name, f in [("zero", np.zeros(240)), ("long-run mean 0.4", np.full(240, 0.4))]:
    lo, hi = interval(demand, f)
    mae = np.mean(np.abs(demand - f))
    print(f"{name:18s} bias = {bias_pct(demand, f):+7.1f} %  [{lo:+.1f}, {hi:+.1f}]   MAE = {mae:.3f}")

Output, produced by running the code above when this page was built:

zero               bias =  -100.0 %  [-100.0, -100.0]   MAE = 0.346
long-run mean 0.4  bias =   +15.7 %  [-5.0, +45.5]   MAE = 0.513

The zero forecast has a bias of −100 %: it never supplies a unit. It also has the lower absolute error. Accuracy alone would have chosen it. The forecast at the long-run mean shows a positive bias on this sample, with an interval that includes zero: 240 periods of a slow item do not pin the bias down.

Where it misleads

  • Errors of opposite sign cancel. A forecast that is far too high in winter and far too low in summer can show a bias of zero. Bias is read next to an accuracy measure, never in its place.
  • Pooled over a catalogue, the percentage is driven by the high-volume items. Compute it by segment as well.
  • On a short window the interval around the bias is wide. The example prints it for that reason: a bias of +5 % with an interval from −10 to +20 is not evidence of over-forecasting.

Bias in the mean also says nothing about the tails. A method can be unbiased and still give reorder points that are too low, which coverage reveals.

In our work

Bias is the first number we report on a demand forecast. On 2,404 spare-part series a model trained across all series over-forecast by 6 %, against 16 % to 37 % for the smoothing methods, while a forecast of zero had the best MASE.

References

  1. Hyndman, R. J., Koehler, A. B. (2006). Another look at measures of forecast accuracy. International Journal of Forecasting, 22(4), 679-688. doi:10.1016/j.ijforecast.2006.03.001
  2. Kolassa, S. (2016). Evaluating predictive count data distributions in retail sales forecasting. International Journal of Forecasting, 32(3), 788-803. doi:10.1016/j.ijforecast.2015.12.004
  3. Hewamalage, H., Ackermann, K., Bergmeir, C. (2023). Forecast evaluation for data scientists: common pitfalls and best practices. Data Mining and Knowledge Discovery, 37, 788-832. doi:10.1007/s10618-022-00894-5

Have a question like this one on your own data? Tell us what you need in a few lines.

Send us the brief

Related pages

  • MASE: mean absolute scaled errorMASE compares the absolute error of a forecast with the error a naive forecast made on the history. Below 1, the forecast beats that naive benchmark. On series that are mostly zeros, a forecast of zero gets the best score.
  • MAE or RMSE: which forecast each one rewardsThe absolute error is smallest when the forecast is the median of what can happen, the squared error when it is the mean. On skewed data these are different numbers, so the choice of measure is a choice of forecast.
  • Croston's methodCroston's method splits an intermittent series in two: how much is ordered when there is an order, and how long between orders. Each is smoothed separately and the forecast is their ratio. The ratio is biased upward.
All library pages