GARETH GRANTTECHNOLOGY · DATA · INNOVATION
Explore

34 / Forecasting

Moving averages and simple exponential smoothing

A trailing moving average gives recent periods equal weight, while simple exponential smoothing gives progressively less weight to older observations. Both are useful baseline forecasting methods for a changing local level, provided their limitations with trend, seasonality and disruptions are understood.

FoundationLive exploration + Python

The business question

What transparent short-term forecast can be built from recent demand?

  • Create an inspectable demand baseline for routine purchasing or staffing discussions.
  • Smooth short-term noise in comparable, regularly spaced operational measurements.
  • Compare a simple forecast with a proposed complex model before accepting the extra maintenance effort.

How the method works

A k-period moving-average forecast is the mean of the latest k observations available when making the forecast. A smaller window reacts more quickly and is noisier; a larger window is steadier and can lag genuine change. A centred moving average may be useful for historical description, but it uses later values and is not a legitimate real-time forecast rule.

Simple exponential smoothing updates a level estimate using a weighted combination of the newest actual observation and the previous level. The smoothing parameter alpha lies between zero and one. A larger alpha responds more sharply; a smaller value preserves more history. Repeated substitution shows that older observations receive weights that shrink geometrically.

Without a trend or seasonal component, the standard multi-period SES point forecast is a flat continuation of the latest estimated level. That makes it unsuitable for mechanically extending strong growth or regular holiday patterns. Choose the window or alpha using earlier rolling validation and compare with a naïve last-value forecast. Uncertainty and lead-time demand, rather than a single point alone, must inform stock or staffing decisions.

The calculation

Moving-average forecast = (y_t+…+y_(t−k+1))/k; level_t = αy_t+(1−α)level_(t−1); SES forecast_(t+h) = level_t
Read the symbols
SymbolMeaning
kNumber of past observations in the trailing window.
αSmoothing weight between zero and one.
y_tLatest actual observation known at the forecast origin.
level_tUpdated estimate of the current level.

A worked business example

ILLUSTRATIVE SCENARIO

Illustrative weekly demand for a regularly stocked consumable, with six complete observations.

Inputs

  • Demand: 100,110,105,120,115,130 units.
  • Moving-average window: three weeks.
  • SES alpha=0.3; initialise the level to the first observation, 100.

Work through the numbers

  1. The naïve forecast for the next week is the last observed demand, 130.
  2. The three-week moving-average forecast is (120+115+130)/3≈121.667.
  3. SES successive levels after the first are 103, 103.6, 108.52, 110.464 and 116.3248.
  4. The final SES next-period forecast is approximately 116.325 units.
The three simple methods disagree because they balance current change and noise differently.

There is no later observation here, so no method has demonstrated greater accuracy. The rising example also illustrates lag: a smooth estimate can understate continuing growth, while reacting to a temporary peak can overstate future demand.

Explore the decision

Explore simple next-period forecasts. The live explorer has its own example inputs; it is separate from the worked calculation above.

Enable JavaScript to use this calculator. The worked example and executable Python remain available.

Apply it at work

  1. Prepare a time-ordered series with a consistent interval and distinguish missing periods from genuine zeros.
  2. Plot demand and identify trend, seasonal patterns, promotions, stockouts and structural changes.
  3. Choose candidate windows or alpha values using only information available at each historical forecast origin.
  4. Compare with naïve and relevant seasonal baselines at the actual planning horizon, then monitor bias and error.

Check these assumptions

  • Measurements are comparable, correctly ordered and regularly spaced for the chosen update rule.
  • Historical demand is informative about the local level during the intended forecast period.
  • Unmodelled trend, seasonality or known interventions are not being mistaken for random noise.
  • Training and tuning use earlier observations only; future outcomes are reserved for evaluation.

Common mistakes and how to avoid them

  • Using a centred average as a real-time forecast leaks future information.
  • Treating observed sales during stockouts as unconstrained demand can bias the forecast downwards.
  • Choosing the smoothest-looking line or the best in-sample fit ignores the business forecast horizon and future error.

How this can help the business

  • A purchasing team obtains a low-maintenance forecast that can serve as a credible comparison for more elaborate systems.
  • Managers can explicitly debate responsiveness and stability while measuring the cost of shortages and excess stock.
A decision rule to adapt

Keep the simplest method that delivers acceptable rolling-origin error and bias for the planning horizon; add trend or seasonality when the evidence and operating context require them.

When to use another approach

Use Holt’s trend methods, seasonal naïve or Holt–Winters for recurring patterns, intermittent-demand methods for sparse items, or a causal forecast model with known drivers.

Reproduce the worked example in Python

The code is self-contained for this example. Dependencies and run instructions are included with the downloadable notebook.

Show executable code and recorded output
import numpy as np
sales = np.array([100,110,105,120,115,130])
alpha = 0.3
level = float(sales[0])
for value in sales[1:]:
    level = alpha*value + (1-alpha)*level
print("Naive next-period forecast:", sales[-1])
print("Three-period moving average:", round(sales[-3:].mean(),3))
print("Simple exponential smoothing:", round(level,3))
print("These forecasts must be compared on later observations.")

Recorded output

Naive next-period forecast: 130
Three-period moving average: 121.667
Simple exponential smoothing: 116.325
These forecasts must be compared on later observations.
Download all worked examples

Sources and further reading

Concepts are linked to primary teaching or technical sources. The business examples are illustrative applications, not reported client results.