01 / 21

Moving Average &
Smoothing

Learn how to tame noisy data with simple and weighted moving averages, then discover exponential smoothing for powerful forecasting.

Business Analytics

What is Data Smoothing?

Real-world data is noisy: daily sales jump around, stock prices spike and dip, and website traffic fluctuates wildly. Smoothing filters out short-term noise so you can see the underlying trend.

Time Value Raw data Smoothed

Why Smoothing Matters in Business

Forecasting
Predict next month's sales, inventory needs, or staffing requirements by identifying the underlying trend.
Trend Detection
See whether your KPIs are truly growing, declining, or staying flat beneath the daily noise.
Decision Making
Base strategic decisions on smoothed signals rather than reacting to random day-to-day fluctuations.

The Simple Moving Average (SMA)

A Simple Moving Average replaces each data point with the average of the surrounding \( n \) points. For a window of size \( n \):

The parameter \( n \) is called the window size. A larger \( n \) produces a smoother curve but reacts more slowly to changes.

Visualizing a 3-Period SMA

1 2 3 4 5 6 7 Day 0 10 20 30 10 20 15 25 20 30 25 15 20 20 25 25 Window (n=3) Raw SMA-3

Introducing Exponential Smoothing

Unlike SMA, Exponential Smoothing gives more weight to recent observations and less weight to older ones. It uses a single parameter \( \alpha \) (alpha) between 0 and 1:

\( \alpha \) close to 1
Reacts quickly to changes but retains more noise.
\( \alpha \) close to 0
Very smooth, but slow to react to real trend shifts.

How \( \alpha \) Affects the Curve

Time Raw α=0.8 α=0.3 α=0.1

SMA vs. Exponential Smoothing

Simple Moving Average Exponential Smoothing
Weighting Equal weight to all \( n \) points Exponentially decaying weights
Key Parameter \( n \) (window size) \( \alpha \) (smoothing factor)
Responsiveness Slower to react Adjustable: fast or slow
Memory Only last \( n \) values All past data (fading)
Complexity Very simple Slightly more complex
Best For Stable, steady data Trend-shifting, volatile data

The Weighted Moving Average

A Weighted Moving Average (WMA) lets you assign custom importance to each point in the window. The most recent point usually gets the highest weight:

SMA
All weights equal: \( \frac{1}{n} \) each.
WMA
Custom weights: recent data matters more.
Exponential
Weights decay exponentially via \( \alpha \).

How to Apply Smoothing

1
Collect your time-series data. Organize observations in chronological order (e.g., daily sales for the past month).
2
Choose your method. SMA for simplicity, WMA for custom emphasis, or Exponential Smoothing for adaptive forecasting.
3
Select your parameter. Window size \( n \) for SMA/WMA, or smoothing factor \( \alpha \) for exponential smoothing.
4
Compute each smoothed value. Slide the window forward one period at a time and calculate the average (or apply the exponential formula).
5
Evaluate and adjust. Compare the smoothed output to the raw data. If too noisy, increase \( n \) or decrease \( \alpha \). If too sluggish, do the opposite.

Example 1: Computing SMA-4

A coffee shop records daily sales (in units) over 7 days: 40, 55, 45, 60, 50, 65, 55. Compute the 4-day SMA.

Day Sales \( x_t \) SMA-4
140--
255--
345--
46050.0
55052.5
66555.0
75557.5

Example 2: Exponential Smoothing

Using the same data: 40, 55, 45, 60, 50, 65, 55 with \( \alpha = 0.3 \). Set \( S_1 = x_1 = 40 \).

Day \( x_t \) \( S_t \)
14040.0
25544.5
34544.7
46049.3
55049.5
66554.1
75554.4

Example 3: Choosing the Right Parameter

A retailer's weekly revenue data has a strong upward trend. Compare SMA-3 vs. Exponential Smoothing (\( \alpha = 0.5 \)) on data: 100, 120, 110, 140, 130, 160, 150.

Raw SMA-3 EXP (α=0.5) W1 W2 W3 W4 W5 W6 W7

Why "Exponential" Smoothing?

When you expand the recursive formula, each past observation gets a weight of \( \alpha(1-\alpha)^k \), which decays exponentially with age \( k \):

Periods ago (k) Weight 0.30 0 0.21 1 0.15 2 0.10 3 0.07 4 0.05 5 0.04 6 0.02 7

Common Mistakes to Avoid

✕ Wrong Window Size
Choosing \( n \) too small (e.g., 2) barely smooths, while too large (e.g., 50) kills real trends. Match \( n \) to your data's cycle length.
✕ Forgetting Lost Points
SMA of window \( n \) produces \( n-1 \) fewer data points than you started with. Don't ignore this data loss when comparing methods.
✕ Ignoring Initialization
Exponential smoothing needs an initial value \( S_1 \). Using a bad starting point (like zero) skews the first several smoothed values.

Summary: Three Methods Compared

SMA WMA Exp. Smoothing
Formula \( \frac{1}{n}\sum_{i=0}^{n-1} x_{t-i} \) \( \frac{\sum w_i x_{t-i+1}}{\sum w_i} \) \( \alpha x_t + (1-\alpha) S_{t-1} \)
Parameter \( n \) \( n \) + weights \( \alpha \)
Data Loss \( n-1 \) points \( n-1 \) points None
Recent Emphasis None Custom Automatic (exponential)
Best Use Stable, cyclic data Known trend patterns Volatile / trending data

Question 1 of 5

What does the window size \( n \) control in a Simple Moving Average?

Question 2 of 5

Given data 10, 20, 30, what is the 3-period SMA for the third point?

Question 3 of 5

In exponential smoothing with \( \alpha = 0.4 \), \( S_1 = 50 \), and \( x_2 = 60 \), what is \( S_2 \)?

Question 4 of 5

Which statement about the smoothing factor \( \alpha \) is correct?

Question 5 of 5

A key advantage of exponential smoothing over a Simple Moving Average is that it: