Weighted Moving Average (WMA)
What you'll learn: How to give more importance to recent observations when smoothing time series data by applying different weights to values in your moving window.
The Core Idea
In a Simple Moving Average (SMA), every observation in the window gets equal treatment—yesterday's value counts just as much as last week's. But often in time series, recent data is more relevant than older data. A Weighted Moving Average (WMA) solves this by multiplying each observation by a weight, giving you control over which values matter most.
Think of it like asking friends for restaurant recommendations. You might value your foodie friend's opinion more than someone who rarely eats out—each person's vote gets a different weight based on relevance.
How It Works
In a WMA, you assign weights to each observation in your window. Typically:
- Recent observations get larger weights
- Older observations get smaller weights
- All weights sum to 1 (to keep the average meaningful)
For example, with a 3-period WMA using weights [0.5, 0.3, 0.2]:
- Most recent value gets 50% influence
- Middle value gets 30% influence
- Oldest value gets 20% influence
You multiply each value by its weight, then sum them up.
Why Use WMA?
WMA is more responsive to recent changes than SMA while still smoothing out noise. It strikes a balance: you're not ignoring history completely, but you're acknowledging that yesterday's sales figures probably tell you more about tomorrow than last month's do.
The tradeoff? Choosing weights is subjective—there's no single "correct" weighting scheme, though linearly decreasing weights are common.
Key Takeaway: Weighted Moving Average lets you emphasize recent observations over older ones by applying larger weights to more current data, making your smoothed series more responsive to recent trends.