What is the simplest possible forecast?

That the next period will be the same as the last. Tomorrow's sales will equal today's. It is called the naive forecast, and for series that drift without much pattern, such as share prices or exchange rates, it is notoriously hard to improve on.

For anything with a yearly or weekly rhythm there is a better version, the seasonal naive forecast. Next Tuesday will be like last Tuesday. This December will be like last December.

It costs nothing and needs no software. Every other method should be judged by how much better it does than this.

Why insist on a baseline?

Because without one, there is no way to know whether a model is any good.

A vendor reports that its forecasts are "92 per cent accurate". Is that impressive? If the seasonal naive method achieves 91 per cent on the same series, the elaborate system has bought one point. If naive achieves 94, it has made things worse.

A measure called MASE, proposed by the forecaster Rob Hyndman, builds this in. It divides a method's error by the error of the naive forecast. A value below 1 means the method beats naive, and a value above 1 means it does not.

Do simple methods really compete?

The evidence comes from a series of open forecasting competitions organised by Spyros Makridakis from 1982 onwards. Entrants forecast large collections of real series, and the results are scored on data they have not seen.

The repeated finding, over forty years, has been that complex methods do not reliably beat simple ones. In the 2018 competition, covering 100,000 series, the pure machine-learning entries performed worse than standard statistical methods. The winner was a hybrid of the two. Combinations of several simple methods did very well.

The 2020 competition used daily sales of some 30,000 products from a large American retailer. Here machine-learning methods, particularly gradient-boosted trees, took the top places. The data had features that favoured them: many related series, plus prices, promotions and calendar events as inputs.

The lesson is not that either approach is better. It depends on the data, and you find out by testing.

What is the next step up from naive?

Three classical ideas, each simple.

Averaging. A naive forecast copies the last value, noise included. A moving average of the last few periods smooths the noise.

Exponential smoothing. A weighted average in which recent observations count for more and older ones progressively less. Developed in the 1950s and still among the most widely used methods in business. Extended versions handle trend and seasonality.

Decomposition. Separate a series into three parts: a trend, a repeating seasonal pattern and what is left over. Forecast each and put them back together.

These methods are in every statistics package and several are in spreadsheets. On a single series with a couple of years of history, they are frequently as good as anything.

How should a forecast be tested?

On data it has not seen, in the order time runs.

Hide the most recent three months. Fit the method to everything earlier. Forecast the hidden months and compare with what happened. Then roll forward: add a month, forecast again. This is called a rolling-origin evaluation, and it imitates how the forecast will actually be used.

Choosing test data at random, as is done for many machine-learning problems, is wrong for forecasting. It lets the model see the future on both sides of each test point.

How is error measured?

Several ways, and they do not always agree.

Measure What it is Watch out for
Mean absolute error Average size of the miss, in units Cannot be compared across products of different scale
Mean absolute percentage error Average miss as a percentage of actual Explodes when actual sales are near zero; penalises over-forecasts more than under-forecasts
Root mean squared error Like absolute error, with large misses weighted more Dominated by a few bad days
Bias Average of forecast minus actual, keeping the sign A forecast can have low error and still be consistently high or low
MASE Error relative to the naive forecast Less intuitive to explain

Report bias alongside any of the others. A forecast that is always 5 per cent high will fill a warehouse.

Choose the measure by what an error costs. If running out of stock costs far more than holding a little extra, the two directions should not be weighted equally.

When does machine learning earn its place?

Where there is information beyond the history of the series itself, and plenty of data.

  • Many related series. Thousands of products or hundreds of shops. A single model can learn patterns across all of them, which helps most for items with short histories.
  • Known drivers. Prices, promotions, holidays, school terms, paydays, weather, local events. Classical methods use these awkwardly. Tree-based models use them readily.
  • Interactions. A promotion that works differently on a Saturday, in summer, for one category.
  • New products, forecast from the behaviour of similar ones.

In those conditions, gradient-boosted trees on a table of engineered features are the dependable choice. The features are things such as sales in the same week last year, the average of the last four weeks, day of week, days until the next holiday, and whether a promotion is running.

Deep learning models for time series exist, and large pre-trained ones have appeared recently. They can do well on very large collections. For most organisations they are not the place to start.

What do all methods get wrong?

Promotions and stock-outs in the history. A week when sales doubled because of a discount, or fell to zero because the shelf was empty, is not information about normal demand. Unless these periods are marked, the model learns them as if they were. Recorded sales are not the same as demand: you cannot sell what you do not have.

Structural breaks. A pandemic, a new competitor, a change of price or range. History before the break may be a poor guide. No method forecasts the break itself.

Intermittent demand. Spare parts that sell twice a year. Most methods forecast a small fraction of a unit every period, which is useless. Specialised methods exist.

Aggregation. Forecasts for the total and for the individual items, made separately, will not add up. Totals are easier to forecast than their parts, and there are methods for reconciling them.

Should a forecast be one number?

No. A point forecast of 400 units says nothing about whether 350 or 500 is plausible, and the decisions that depend on it, such as how much safety stock to hold or how many staff to roster, depend on exactly that.

A useful forecast gives a range: an 80 per cent interval of 340 to 470, say. Most methods can produce one. Check whether the intervals are honest. If actual values fall inside the 80 per cent interval only half the time, the intervals are too narrow, which is the usual fault.

What about human judgement?

It has a mixed record, and research on it is extensive.

Adjustments made by people who know something the model does not, such as a large order coming, a competitor closing or a product being withdrawn, improve accuracy. Small adjustments made because the number "looks low" generally make it worse, and people adjust upwards far more often than downwards.

Good practice is to record every manual adjustment with a reason, and to measure afterwards whether the adjusted or the unadjusted forecast was closer. Organisations that do this usually find that a few people add value and many do not.

What is a sensible sequence?

  1. Plot the series. Look at it. Many problems are visible.
  2. Clean the history: mark promotions, stock-outs and one-off events.
  3. Compute the seasonal naive forecast and its error over several past periods.
  4. Try exponential smoothing. Compare.
  5. If there are known drivers and many series, build a table of features and try gradient-boosted trees. Compare, on held-out periods, against both.
  6. Consider averaging the two best. Combinations are remarkably robust.
  7. Produce intervals as well as point forecasts.
  8. Put it into use beside the existing process, and track error and bias every month.
  9. Revisit when the error drifts.

What is the usual outcome?

More often than vendors suggest, step four is where it ends. A well-specified simple method, with clean history and a known baseline, gets most of the available accuracy. The remaining gain from complexity is real in some businesses and negligible in others.

The comparison against the baseline is what tells you which kind of business yours is, and it takes about a day.