A shop wants to predict tomorrow’s demand for bread, and a smooth curve drawn through last month’s sales follows the data closely. That closeness says little about forecasting, because the curve at each day may have been built from sales recorded after that day. Every forecasting claim depends on what was known when each prediction would have been made. This lesson compares simple forecasting baselines and smoothers on a short constructed series, evaluates them in time order, and shows what a forecast interval rests on.
Key terms
Forecast horizon
Definition The forecast origin is the last time whose observation is available when a forecast is made, and the forecast horizon is the number of steps ahead being predicted. The forecast of made at origin is written , and it may use only information available at time . On this page the forecast error is the actual value minus the forecast,
so a negative error means that the forecast was too high.
In plain words The origin fixes what the forecaster knows, and the horizon fixes how far ahead the forecast reaches. A method can do well one step ahead and badly ten steps ahead, so an accuracy figure should name its horizon, and methods should be compared on the same origins and horizons. A step means whatever spacing the series has, such as an hour, a day or a month.
Example Eight constructed, equally spaced temperature readings, in degrees, are listed below. They are invented for transparent arithmetic and come from no real study.
| Time | Reading | Time | Reading |
|---|---|---|---|
| 1 | 10 | 5 | 12 |
| 2 | 12 | 6 | 14 |
| 3 | 11 | 7 | 13 |
| 4 | 13 | 8 | 15 |
From origin , the forecast of has horizon and the forecast of has horizon . Both may use and nothing later.
Naive and seasonal naive forecasts
Definition The naive forecast repeats the last observation, for every horizon . For a series with a seasonal period of steps fixed in advance, the seasonal naive forecast at an origin repeats the last observed value from the same seasonal position,
where is the smallest integer that is at least . The index always falls within the last observations, so forecasts more than steps ahead repeat the last observed cycle again.
In plain words These baselines have no fitted parameters and can be computed as soon as enough history exists, so a more elaborate method should beat them on the same evaluation before its extra complexity is worth having. The naive forecast suits a level that wanders unpredictably, and the seasonal naive forecast suits a strong repeating pattern. Neither continues a trend, so both tend to fall behind a series that keeps rising.
Example At origin the naive forecast for time is , and the observed gives an error of degree. Suppose a period of was specified in advance because operating conditions alternate. The seasonal naive forecast for time is then , with error degree. At origin the seasonal naive forecasts for times , and are , and , copied from times , and . The period is an assumption here, since eight invented readings cannot establish a seasonal mechanism.
Moving average
Definition A trailing moving average with window estimates the level at time by the mean of the current observation and the before it,
It uses only data up to time , so it is a one-sided smoother, and as a forecast it gives for every horizon. A centered moving average with odd window averages , so it needs observations after time .
In plain words A trailing average is known at time . A centered average can describe the past well once later data have arrived, but it cannot be computed at time , so presenting it as a forecast hides a look into the future. A longer window damps isolated fluctuations more but reacts more slowly to a change in level, and in a series that rises at every step, a trailing average with stays below the current value. The moving-average part of an ARIMA model is a different idea, a weighted sum of current and past random shocks, and ARIMA models form a larger family that this lesson only names.
Example With the trailing average at time is , and it becomes the forecast for time , where . At time the trailing average is , while the centered average is . The two numbers differ because the centered one uses , which was not available at time .
Exponential smoothing
Definition Simple exponential smoothing with smoothing parameter updates a level by
starting from a stated initial level such as , and forecasts every horizon by the current level, . Unrolling the recursion gives
so for the weights on past observations decline geometrically.
In plain words Each new level moves part of the way from the old level toward the newest observation. A larger follows recent readings more closely, and a smaller one keeps more of the past. For , unlike in a moving average, no observation ever drops out completely, and its weight only keeps shrinking. With the method is the naive forecast, and with the level never leaves its starting value. Simple exponential smoothing has no trend or seasonal component, so its forecasts are flat. The starting value matters in short series, and choosing by looking at the whole series before evaluating earlier forecasts leaks later information into the evaluation.
Example With and , the first update is . Continuing through the series gives the levels at times to . At time the weights on are , and the starting level gets the remaining . Every forecast from origin is degrees, whatever the horizon.
Rolling-origin evaluation and temporal leakage
Definition Rolling-origin evaluation measures forecast accuracy by moving the forecast origin forward through time. At each origin the whole procedure, including any preprocessing and choice of settings, is run using only , a forecast is made for a declared horizon , and it is compared with . The errors collected over the origins are summarized, for example, by
Temporal leakage is any use, in producing a forecast or in choosing how it is produced, of information that would not have been available at its origin. The later value may enter only the comparison that scores the forecast.
In plain words Each forecast is judged as if it had really been issued at its origin. Leakage hides in many places, such as a centered smoother, a mean or scale computed from the whole series, a missing value filled in from later data, a smoothing parameter tuned on the evaluation period, or a data value revised after the forecast date. Mean absolute error counts every miss in proportion to its size, while root mean squared error counts large misses more heavily, so the measure should match which mistakes are costly. If many settings are tried on one evaluation period, that period has become part of the selection, and an honest estimate for the chosen workflow needs a later period that played no part in it.
Example Forecast one step ahead from origins , , and , so the actual values are , , and degrees.
| Method | Forecasts | Errors | MAE | RMSE |
|---|---|---|---|---|
| Naive | 13, 12, 14, 13 | 1.5 | 1.581 | |
| Seasonal naive | 11, 13, 12, 14 | 1, 1, 1, 1 | 1 | 1 |
| Trailing average | 12, 12, 13, 13 | 0, 2, 0, 2 | 1 | 1.414 |
| Exponential smoothing | 12, 12, 13, 13 | 0, 2, 0, 2 | 1 | 1.414 |
The seasonal naive rule uses , the trailing average uses and exponential smoothing uses , all fixed in advance. The root mean squared errors are , , and . Three methods tie on mean absolute error, and the seasonal naive rule has the smallest root mean squared error, although its errors are all , so it underpredicts every time while the level rises. The trailing average and exponential smoothing give identical forecasts only by coincidence of these data, this and this starting value. Four errors are a tiny demonstration and say little about which method is better in the long run, and forecast errors in a time series can be correlated, so their uncertainty needs more than independent-error formulas.
Forecast interval
Definition A forecast interval, also called a prediction interval, for is an interval, computed from the information at origin , that has a stated probability of containing the future value under a stated model. In the Gaussian random walk without drift, with independent increments and known, the value steps ahead is the current value plus independent increments. Given , the future value is therefore normal with mean and variance , and
is a central 95 percent forecast interval, where rounds the standard normal quantile . This random walk is the model, since one difference leaves independent noise.
In plain words A point forecast says nothing about how far off it may be, and an interval is only as trustworthy as the model behind it. In the random walk the margin grows like , because the variances of independent increments add, and other models give other patterns. A forecast interval is a probability statement about a future observation, not a confidence interval for a fixed mean. When or other parameters are estimated, their uncertainty and the fit of the model also affect whether the stated probability is achieved.
Example Take the declared model with current value degrees and known increment standard deviation degrees, not estimated from the eight readings. One step ahead the interval is , about degrees. Four steps ahead the margin is , which gives about degrees, twice as wide as one step ahead and not four times. Forecasts from the seasonal naive rule or from exponential smoothing need an error model of their own before an interval like this can be attached to them.
Check yourself
- Using the eight readings, give the naive, seasonal naive with and trailing three-point average forecasts made at origin for times and , and their errors.
Show the answer
At origin only are available. The naive forecast is for both times, with errors and . The seasonal naive forecast for time copies time , giving , and for time copies time , giving , with errors and . The trailing average at time is , used for both horizons, with errors and . The forecast for time has horizon and still uses nothing after time .
- An analyst computes a centered three-point average of the eight readings, chooses the window and the smoothing settings by trying several on all eight readings, and reports the centered values at times 2 to 7 as one-step forecasts. Identify the information problems and describe a repaired evaluation. Which error measure fits better if large misses are especially costly?
Show the answer
The centered value at time averages , and , so it uses the very value it claims to predict and the one after it. A one-step forecast of from origin may use only . At time , for example, the centered value uses and . Choosing the settings on all eight readings adds a second leak, because later readings influence every earlier evaluation.
A repaired evaluation fixes the horizon, moves the origin forward, and at each origin computes a trailing smoother and chooses any settings using only the data up to that origin. Each forecast is then compared with the value that arrives afterward. To judge the whole workflow, including the choice of settings, a final later stretch of the series is kept aside and used once. If large misses are especially costly, root mean squared error matches that concern better than mean absolute error, because squaring weights large errors more heavily.
- In a Gaussian random walk without drift, the current value is and the increments have known standard deviation . Find the central 95 percent forecast intervals for and , and compare their widths. Is either one a confidence interval for a mean?
Show the answer
For the margin is , so the interval is about . For the margin is , so the interval is about . The second is times as wide as the first, not times, because the variance grows in proportion to and the standard deviation in proportion to .
Neither is a confidence interval for a mean. Each is a probability statement about the single future value , and under this model with known , given the current value , the future value falls inside with probability , up to the rounding of . That probability comes from the model, so it is only as reliable as the random walk assumption.