Exponential Smoothing
Before jumping into advanced forecasting models, we need to understand one of the most important ideas in time series analysis:
Not all past data should be treated equally.
A Real-World Situation
Imagine you manage inventory for a grocery store. You track daily milk sales.
Sales from yesterday are very important. Sales from last week matter a little less. Sales from last year hardly matter at all.
So the key question becomes:
How do we give more importance to recent data and less to old data?
That is exactly what Exponential Smoothing does.
The Core Idea (Very Important)
Exponential Smoothing creates forecasts by:
- Giving high weight to recent observations
- Giving lower weight to older observations
- Reducing noise without ignoring new changes
Unlike moving averages, it does this smoothly and continuously.
Simple Exponential Smoothing (SES)
Simple Exponential Smoothing is used when:
- No strong trend
- No seasonality
- Level changes slowly over time
Examples:
- Daily demand for consumables
- Website error rates
- Sensor measurements
Simulated Daily Demand Data
Let’s simulate realistic daily demand with small fluctuations.
import numpy as np
import matplotlib.pyplot as plt
np.random.seed(1)
time = np.arange(80)
demand = 50 + np.random.normal(0, 5, 80)
plt.figure(figsize=(9,4))
plt.plot(demand)
plt.title("Daily Product Demand")
plt.xlabel("Day")
plt.ylabel("Units Sold")
plt.show()
What you see:
- No clear upward or downward trend
- Random short-term fluctuations
- Exactly the kind of data SES is designed for
How Exponential Smoothing Thinks
Instead of averaging a fixed window, SES updates its estimate like this:
New estimate = recent value + memory of the past
The balance is controlled by a smoothing factor called alpha (α).
- Small α → smoother line, slower reaction
- Large α → reacts quickly, less smoothing
Smoothed Demand Curve
alpha = 0.3
smoothed = []
for i, val in enumerate(demand):
if i == 0:
smoothed.append(val)
else:
smoothed.append(alpha * val + (1 - alpha) * smoothed[i-1])
plt.figure(figsize=(9,4))
plt.plot(demand, label="Actual")
plt.plot(smoothed, label="Smoothed")
plt.legend()
plt.show()
What this plot tells us:
- The smoothed line follows the general level
- Random spikes are softened
- Recent changes still influence the forecast
This is the key strength of exponential smoothing.
Choosing the Right Alpha
Alpha controls how quickly the model reacts.
- α = 0.1 → very smooth, slow response
- α = 0.5 → balanced smoothing
- α = 0.9 → reacts almost instantly
Different businesses choose different values depending on stability.
Why SES Fails Sometimes
Simple Exponential Smoothing cannot handle:
- Strong upward or downward trends
- Seasonal repetition
That’s why we later introduced:
- Holt → adds trend
- Holt-Winters → adds seasonality
SES is the foundation for all of them.
Residual Check
Good residuals mean:
- No visible pattern left
- Only random noise remains
Where Exponential Smoothing Is Used
- Inventory planning
- Short-term demand forecasting
- Monitoring systems
- Signal smoothing
Practice Questions
Q1. Why is exponential smoothing better than simple averaging?
Q2. What happens if alpha is too high?
Key Takeaways
- Exponential smoothing weights recent data more
- SES works best without trend or seasonality
- Alpha controls responsiveness
- It is the base of all smoothing models
Next, we’ll learn how to evaluate and compare forecasting models properly.