Moving Averages in Quantitative Forecasting
A simple moving average (SMA) forecasts the next period as the average of the most recent n periods of actual demand. It smooths random noise so the underlying level becomes visible. It is one of the easiest time-series forecasting methods to learn, and a useful baseline against which to compare anything more advanced.
The formula
Forecast(t+1) = ( Dt + Dt-1 + … + Dt-n+1 ) ÷ n
Each new period, the oldest value drops out and the newest value joins, which is why the window “moves”.
Worked example: ABC Clothing
Monthly sales (units): Jan 100, Feb 120, Mar 110, Apr 130, May 140, Jun 150, Jul 160, Aug 155, Sep 145, Oct 135, Nov 120, Dec 125. A three-month moving average gives:
| Month | Actual | 3-month MA (ending this month) | Forecast for this month | Error (actual − forecast) |
|---|---|---|---|---|
| Jan | 100 | |||
| Feb | 120 | |||
| Mar | 110 | 110.0 | ||
| Apr | 130 | 120.0 | 110.0 | +20.0 |
| May | 140 | 126.7 | 120.0 | +20.0 |
| Jun | 150 | 140.0 | 126.7 | +23.3 |
| Jul | 160 | 150.0 | 140.0 | +20.0 |
| Aug | 155 | 155.0 | 150.0 | +5.0 |
| Sep | 145 | 153.3 | 155.0 | −10.0 |
| Oct | 135 | 145.0 | 153.3 | −18.3 |
| Nov | 120 | 133.3 | 145.0 | −25.0 |
| Dec | 125 | 126.7 | 133.3 | −8.3 |
The forecast for January is the December moving average: 126.7 units. Over the nine months with forecasts, the mean absolute deviation (MAD) is 150 ÷ 9 ≈ 16.7 units.
Look at the errors. While sales were climbing (April to July), the forecast was always too low (positive errors). When sales turned down (September to November), the forecast was too high. That systematic pattern is the main weakness of the method: it lags.
Choosing the window size
| Short window (n = 2 to 3) | Long window (n = 6 to 12) |
|---|---|
| Reacts quickly to change | Smooths noise strongly |
| Follows noise too, so the forecast is jumpier | Reacts slowly to real change, so lag is larger |
| Better for items whose level shifts often | Better for stable items with random variation |
Test several window sizes on your history and choose the one with the lowest error, such as MAD or MAPE, on data it was not fitted to.
Limits of the simple moving average
- Lags trends: it underforecasts a rising series and overforecasts a falling one.
- Ignores seasonality: for seasonal products it simply averages the seasons together.
- Treats all periods in the window equally: last month counts the same as two months ago. Weighted methods fix this. See Weighted Moving Averages.
- Needs n periods of data for each item, which is a lot of storage for large catalogs.
- Gives one flat forecast for all future periods.
When to use it
Use a moving average for stable demand with no strong trend or seasonality, as a quick baseline, or to smooth data before looking for patterns. For data with trend or seasonality, look at methods built for them, such as exponential smoothing with trend or seasonal models. For more complex series see ARIMA.
Using the forecast in planning
A forecast is the input to order quantities and, with the forecast error, to safety stock. The MAD above can be converted to an approximate standard deviation of forecast error: σ ≈ 1.25 × MAD ≈ 21 units per month, which feeds directly into the safety stock formula.
Common mistakes
- Using a moving average on a clearly trending or seasonal series.
- Forgetting that the moving average for a month is the forecast for the next month.
- Picking the window by eye instead of by testing the error.
- Not measuring the forecast error at all.
Key takeaways
- Simple moving average = average of the last n actual values, used as the next forecast.
- Short windows react quickly but are noisy. Long windows are smooth but slow.
- It lags trends and ignores seasonality, so use it where demand is stable.
- Always measure forecast error to compare methods.
Put it into practice
Ready-made tools that apply this topic:
- Demand Forecasting Excel Template ($1.09)
- Excel Demand Forecasting Template ($1.98)
Frequently asked questions
What is a simple moving average in forecasting?
A simple moving average forecasts the next period as the average of the last n periods of actual demand. It smooths random fluctuations and works best when demand is stable, without strong trend or seasonality.
How do you calculate a 3-month moving average?
Add the last three months of actual values and divide by three. For sales of 120, 110 and 130 units the average is 120, which becomes the forecast for the next month.
How do I choose the window size for a moving average?
Short windows react faster but follow noise, while long windows are smoother but lag changes. Test several window sizes on historical data and choose the one with the lowest forecast error.
Why does a moving average lag behind trends?
Because it averages older values with newer ones, the forecast sits behind the current level. In a rising series it underforecasts, and in a falling series it overforecasts.
What is the difference between a simple and a weighted moving average?
A simple moving average gives every period in the window equal weight. A weighted moving average gives larger weights to recent periods so it responds faster to change.
