Forecasting: moving average and exponential smoothing
Naive, simple and weighted moving averages, simple exponential smoothing and Holt's trend method, with the effect of n and α, data age and lag under trend.
Drafted with Aria, reviewed by the AiCanCode.org team. Spotted an error? Use Give Feedback at the bottom of the page.
Why it matters
Every production plan starts with a demand forecast: aggregate plans, master schedules, inventory reorder points and capacity decisions all use it. Moving averages and exponential smoothing are the time-series methods most plants actually run in their ERP systems because they need only past demand and are cheap to update every period.
Key ideas
Time-series components. Past demand is viewed as a mix of level (average), trend (steady rise or fall), seasonality (repeating pattern within a year, week or day), cycle (longer, irregular swings) and random variation (noise that cannot be forecast). Averaging methods try to remove the noise and keep the level.
Naive forecast. Next period's forecast equals this period's actual demand. It reacts fully to noise and is the benchmark that any better method must beat.
Simple moving average (SMA). The forecast is the unweighted mean of the last n actual demands. When a new period's actual arrives, the oldest value is dropped – the window "moves".
- Large n → more smoothing, slower response to real changes.
- Small n → quick response, but more noise passes through.
- With a trend, the SMA always lags behind: for a linear trend of b units per period, the lag is b(n + 1)/2 units.
Weighted moving average (WMA). Each of the last n demands gets a weight, usually larger for recent periods; the weights sum to 1. It responds faster than an SMA of the same length, but the weights are chosen by judgement or trial.
Simple (single) exponential smoothing (SES). The new forecast is the old forecast corrected by a fraction α of the last forecast error: new forecast = old forecast + α × (actual − old forecast). Expanding this shows that the weight on the demand k periods old is α(1 − α)^k, so the weights decrease geometrically and every past observation keeps a small weight. Only the last forecast, the last actual and α need to be stored.
- α lies between 0 and 1; typical values are 0.1–0.3 for stable demand.
- High α: fast response, more nervous forecasts. Low α: smooth, slow forecasts.
- The average age of data used is (1 − α)/α periods for SES and (n − 1)/2 for an n-period SMA (counting the latest period as age 0). Equating them gives the usual "equivalent" smoothing constant α = 2/(n + 1).
- SES needs a starting forecast. Common choices are the first actual demand or the average of the first few periods; its effect dies out after several periods.
- Like the SMA, SES lags a trend and cannot model seasonality.
Trend-adjusted (double, Holt's) exponential smoothing. Smooths the level with α and the trend with a second constant β, and forecasts level + trend. Seasonal data need seasonal indices or the Holt–Winters (triple) method.
Choosing a method. Use SMA or SES for demand with no clear trend or seasonality (spare parts, consumables). Choose n or α by comparing forecast errors (MAD, MSE, tracking signal) on past data, which is the next topic.
Formulas
F(t+1) = [D(t) + D(t−1) + … + D(t−n+1)] / n
- F = forecast (units), D = actual demand (units), t = current period, n = number of periods in the average. Simple moving average.
F(t+1) = Σ wᵢ · D(t−i+1), Σ wᵢ = 1
- wᵢ = weight (dimensionless) on the i-th most recent demand. Weighted moving average.
F(t+1) = α · D(t) + (1 − α) · F(t) = F(t) + α · [D(t) − F(t)]
- α = smoothing constant (dimensionless, 0 < α < 1). Simple exponential smoothing, for level demand.
weight on D(t−k) = α · (1 − α)^k
- Weights of SES on older demands (k = 0, 1, 2, …).
α ≈ 2 / (n + 1)
- Smoothing constant that gives SES the same average data age as an n-period SMA.
L(t) = α · D(t) + (1 − α) · [L(t−1) + T(t−1)]
T(t) = β · [L(t) − L(t−1)] + (1 − β) · T(t−1)
F(t+1) = L(t) + T(t)
- L = smoothed level (units), T = smoothed trend (units per period), β = trend smoothing constant (0 < β < 1). Holt's method, for demand with a trend.
Worked examples
Example 1 (standard) – moving averages. Monthly demand (units): Jan 120, Feb 132, Mar 128, Apr 140, May 136, Jun 150. Forecast July with (a) a 3-month SMA and (b) a 3-month WMA with weights 0.5, 0.3, 0.2 (most recent first).
- SMA: F(Jul) = (D_Apr + D_May + D_Jun)/3 = (140 + 136 + 150)/3 = 426/3 = 142 units.
- WMA: F(Jul) = 0.5 × 150 + 0.3 × 136 + 0.2 × 140 = 75 + 40.8 + 28 = 143.8 units.
- The WMA is higher because it gives more weight to the high June demand; with a rising series it lags less.
Example 2 (GATE level) – exponential smoothing over several periods. Same data, α = 0.3, and the forecast for January is taken as 120 units. Find the forecast for July.
- F(t+1) = F(t) + α[D(t) − F(t)].
- Feb: 120 + 0.3(120 − 120) = 120.00.
- Mar: 120 + 0.3(132 − 120) = 123.60.
- Apr: 123.60 + 0.3(128 − 123.60) = 124.92.
- May: 124.92 + 0.3(140 − 124.92) = 129.444.
- Jun: 129.444 + 0.3(136 − 129.444) = 131.411.
- Jul: 131.411 + 0.3(150 − 131.411) = 136.988.
- F(Jul) ≈ 137.0 units. It is lower than both moving averages because SES with α = 0.3 still carries weight on old, low demands – the lag that appears whenever demand is trending.
Example 3 (trend) – one step of Holt's method. Last level L = 118 units, last trend T = 4 units/month, α = 0.4, β = 0.2, new actual demand D = 126 units.
- New level = 0.4 × 126 + 0.6 × (118 + 4) = 50.4 + 73.2 = 123.6 units.
- New trend = 0.2 × (123.6 − 118) + 0.8 × 4 = 1.12 + 3.2 = 4.32 units/month.
- Next forecast = 123.6 + 4.32 = 127.92 units.
Common mistakes
- Using the current period's actual in an SMA meant to forecast the current period: an n-period SMA for period t+1 uses data up to t only.
- Writing α · F(t) + (1 − α) · D(t): α multiplies the actual demand (or the error), not the old forecast.
- Weights in a WMA that do not add to 1, or applying the largest weight to the oldest period.
- Rounding forecasts at every step in a long SES chain; carry at least two decimals and round only the final answer.
- Expecting SMA or SES to follow a trend: both lag. Use Holt's method or regression.
- Assuming a bigger α is always better because it "reacts faster"; it also passes noise into the plan.
For GATE PI
Typical questions give a short demand series and ask for an n-period moving average, a weighted moving average or a chain of exponentially smoothed forecasts (often with the starting forecast given). Conceptual questions ask the effect of increasing n or α, the weight on an older observation, or the α equivalent to an n-period average. Practise SES chains of four to six periods quickly and accurately, and the error-correction form of the formula.
Quick check
- Demand for the last four weeks: 40, 44, 46, 50. What is the 3-week SMA forecast for next week?
- Last forecast 200, actual 220, α = 0.25. What is the next forecast?
- With α = 0.2, what weight does SES put on the demand two periods ago (k = 2)?
- Which smoothing constant matches a 9-period moving average?
Answers: 1. 46.67 units. 2. 205 units. 3. 0.2 × 0.8² = 0.128. 4. α = 2/10 = 0.2.
Interview questions
All Production Planning and Operations Management interview questionsTry answering each one aloud before you open it.
1.What is a moving average in the context of forecasting?Concept
A moving average is a statistical method used in forecasting to smooth out short-term fluctuations and highlight longer-term trends or cycles. It calculates the average of a set number of past data points, which 'moves' forward as new data becomes available. This technique helps in identifying the underlying trend in a time series data.
2.Explain exponential smoothing and its purpose in forecasting.Concept
Exponential smoothing is a forecasting technique that applies decreasing weights to past observations. The most recent observations are given more weight, making the forecast more responsive to changes. This method is useful for data with no clear trend or seasonal pattern, as it helps in smoothing out noise and capturing the underlying pattern.
3.How does a simple moving average differ from a weighted moving average?Concept
A simple moving average assigns equal weight to all past observations within the specified period, while a weighted moving average assigns different weights to each observation, typically giving more importance to recent data. This allows the weighted moving average to be more responsive to recent changes in the data.
4.Why is exponential smoothing preferred over moving average in some cases?Application
Exponential smoothing needs only the last forecast, the last actual and α, so it is cheap to update for thousands of items in an ERP system, whereas an n-period moving average must store n past values. It weights recent data more heavily and never drops old data abruptly, and its responsiveness is tuned with a single parameter α. Simple exponential smoothing still lags a trend, so for trending demand Holt's (double) smoothing or regression is used.
5.What happens if the smoothing constant (α) in exponential smoothing is set too high?Application
If the smoothing constant (α) is set too high, the forecast becomes overly sensitive to recent changes, which can lead to excessive fluctuations and noise in the forecast. This may result in less accurate predictions, especially if the underlying data has a lot of random variation.
6.In what scenarios would you use a moving average over exponential smoothing?Application
A moving average is more suitable when the data has a stable pattern without significant fluctuations or when the goal is to smooth out short-term variations to identify long-term trends. It is also useful when the data does not exhibit a clear trend or seasonal pattern, and a simple, straightforward approach is desired.
7.Calculate the 3-period moving average for the following data: [10, 20, 30, 40, 50].Numerical
To calculate the 3-period moving average, take the average of each set of three consecutive numbers:
- (10 + 20 + 30) / 3 = 20
- (20 + 30 + 40) / 3 = 30
- (30 + 40 + 50) / 3 = 40 The 3-period moving averages are 20, 30, and 40.
8.Given a smoothing constant (α) of 0.2, calculate the next forecast using exponential smoothing for the demand data 50, 52, 53 (periods 1–3), with an initial forecast F₁ = 50.Numerical
Use F(t+1) = α·D(t) + (1 − α)·F(t). F₂ = 0.2 × 50 + 0.8 × 50 = 50. F₃ = 0.2 × 52 + 0.8 × 50 = 50.4. F₄ = 0.2 × 53 + 0.8 × 50.4 = 10.6 + 40.32 = 50.92. The forecast for period 4 is 50.92 units; it trails the rising demand, which is the usual lag of exponential smoothing.
9.What are the limitations of using moving averages for forecasting?Application
Moving averages can lag behind actual data trends, especially if the data has a strong trend or seasonal pattern. They also do not account for changes in the underlying pattern, as they give equal weight to all observations within the period. Additionally, moving averages can be less effective in capturing sudden changes or shifts in the data.
10.How can the choice of period length in a moving average affect the forecast?Application
The choice of period length in a moving average affects the level of smoothing. A longer period results in more smoothing and less sensitivity to short-term fluctuations, which can be useful for identifying long-term trends. However, it may also cause the forecast to lag behind actual changes. A shorter period provides less smoothing and more responsiveness to recent changes, but it may also capture more noise.
Finished this topic? Mark it so your progress, study plan and readiness keep up.
Stuck on something here?