Moving Average &
Smoothing
Learn how to tame noisy data with simple and weighted moving averages, then discover exponential smoothing for powerful forecasting.
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.
Why Smoothing Matters in Business
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
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:
How \( \alpha \) Affects the Curve
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:
How to Apply Smoothing
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 |
|---|---|---|
| 1 | 40 | -- |
| 2 | 55 | -- |
| 3 | 45 | -- |
| 4 | 60 | 50.0 |
| 5 | 50 | 52.5 |
| 6 | 65 | 55.0 |
| 7 | 55 | 57.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 \) |
|---|---|---|
| 1 | 40 | 40.0 |
| 2 | 55 | 44.5 |
| 3 | 45 | 44.7 |
| 4 | 60 | 49.3 |
| 5 | 50 | 49.5 |
| 6 | 65 | 54.1 |
| 7 | 55 | 54.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.
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 \):
Common Mistakes to Avoid
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: