Definition
With a seasonal period m (7 for daily data with a weekly pattern, 12 for monthly data with a yearly one), the forecast for any future period is the last observed value of the same season:
ft+h = yt+h−m (repeating the last full season)
It is the scale used by MASE for seasonal series: a MASE of 1 is the in-sample error of this forecast. The M4 competition, on 100,000 series, reported every method against simple benchmarks of this kind.
Worked example
Two hundred series of two years of daily sales are simulated, each with a weekly pattern and a level that wanders. Six forecasts are made for the next eight weeks of each series, and their errors are averaged.
import numpy as np
rng = np.random.default_rng(34)
n, h, runs = 730, 56, 200
t = np.arange(n + h)
weekly = np.array([0.8, 0.9, 1.0, 1.0, 1.2, 1.5, 0.6])[t % 7]
dow = np.eye(7)[t % 7]
def poly_forecast(train, degree):
Z = np.column_stack([dow] + [(t / n) ** k for k in range(1, degree + 1)])
beta = np.linalg.lstsq(Z[:n], train, rcond=None)[0]
return Z[n:] @ beta
names = ["mean of the history", "naive (last value)", "seasonal naive (last week)",
"mean of the last 4 weeks, by weekday", "day-of-week + trend, degree 2", "day-of-week + trend, degree 6"]
mase = np.zeros((runs, len(names)))
for r in range(runs):
level = 100 + np.cumsum(rng.normal(0, 1.0, n + h)) # the level wanders
y = level * weekly * rng.lognormal(0, 0.08, n + h)
train, test = y[:n], y[n:]
forecasts = [np.full(h, train.mean()), np.full(h, train[-1]), np.tile(train[-7:], h // 7),
np.tile(train[-28:].reshape(4, 7).mean(0), h // 7), poly_forecast(train, 2), poly_forecast(train, 6)]
scale = np.mean(np.abs(train[7:] - train[:-7]))
mase[r] = [np.mean(np.abs(test - f)) / scale for f in forecasts]
for name, m, w in zip(names, mase.mean(0), (mase <= mase[:, [2]]).mean(0)):
print(f"{name:38s} mean MASE = {m:5.2f} at least as good as seasonal naive in {w:4.0%} of series")Output, produced by running the code above when this page was built:
mean of the history mean MASE = 2.81 at least as good as seasonal naive in 0% of series naive (last value) mean MASE = 2.54 at least as good as seasonal naive in 0% of series seasonal naive (last week) mean MASE = 1.07 at least as good as seasonal naive in 100% of series mean of the last 4 weeks, by weekday mean MASE = 0.96 at least as good as seasonal naive in 70% of series day-of-week + trend, degree 2 mean MASE = 1.23 at least as good as seasonal naive in 46% of series day-of-week + trend, degree 6 mean MASE = 2.12 at least as good as seasonal naive in 18% of series
The seasonal naive forecast is far ahead of the mean and of the last value. The trend model with six polynomial terms fits the history closely and is about twice as bad on the next eight weeks: a polynomial extrapolates away from the data. The only forecast that beats the seasonal naive on average is another benchmark, the mean of the last four weeks by weekday.
Where it misleads
- It carries the noise of one single season into every forecast. Averaging the last few seasons gives a steadier benchmark that is just as simple.
- It ignores trend and calendar effects. Around public holidays, or for a product that grows fast, it is a weak opponent and beating it proves little.
- On intermittent series it mostly repeats zeros, and the relevant control is the zero forecast and the mean of the history.
- A model can beat the benchmark on average and lose to it on the items that matter. Report the share of series where the model wins, with a paired interval.
The benchmark must be scored under the same protocol as the model: same origins, same horizon, same data available, see walk-forward validation.
In our work
Every forecast we deliver is reported against simple controls scored on the same windows. In our studies the controls are a forecast of zero, the last value and a moving average, and each method is given as a paired difference against a reference.
Service: forecasting and statistical studies Research note: intermittent demand forecasting, measured Research note: our gates
References
- Hyndman, R. J., Athanasopoulos, G. (2021). Forecasting: principles and practice, 3rd edition. OTexts, Melbourne. otexts.com/fpp3
- Makridakis, S., Spiliotis, E., Assimakopoulos, V. (2020). The M4 competition: 100,000 time series and 61 forecasting methods. International Journal of Forecasting, 36(1), 54-74. doi:10.1016/j.ijforecast.2019.04.014
- 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