A time series is data measured over time, like monthly sales or quarterly visitors. It usually bounces around with seasonal ups and downs that hide the real story. A moving average smooths out the bumps so the underlying trend stands out.
Replace each point with the average of itself and its neighbours.
Odd window (3, 5, 7): the average lines up neatly with the middle point, done in one step.
Even window (4): the average falls between two points, so you take a second average of neighbouring pairs, that's centring.
Monthly sales: Jan 200, Feb 240, Mar 220, Apr 260, May 240, Jun 280. Find the 3-point moving average for March.
The smoothed value for March is 240, gentler than the raw 220.
• A 4-point (even) moving average must be centred, average the neighbouring pairs so it lines up with a real period.
• Smoothing removes seasonal and random bumps, what's left is the trend.
• You lose points at each end, you can't smooth the very first or last.
• Use the mean unless the question says median.
The pale line is the raw data, jumping up and down each season. The bold line is the moving average, the seasonal noise is gone and the gentle trend appears.
| Window | 4-pt MA |
|---|---|
| Q1 to Q4 | 27.5 |
| Q2 to Q5 | 30.0 |
| Centred at Q3 | (27.5 + 30.0) ÷ 2 = 28.75 |
Each 4-point average sits between two quarters. Average the two neighbouring ones and it now lines up with a real quarter (Q3).
Don't read yet, just have a go in your head:
Sales Feb 240, Mar 220, Apr 260. 3-pt MA at March = (240 + 220 + 260) ÷ 3 = 720 ÷ 3 = 240.
3-pt MA at April = (Mar + Apr + May) ÷ 3 = (220 + 260 + 240) ÷ 3 = ? ÷ 3 = ?
Quarterly data: Q1 = 20, Q2 = 30, Q3 = 25, Q4 = 35, Q5 = 30. Find the 4-point MA for the window Q1 to Q4, and for Q2 to Q5. Check below.
From the two 4-point averages above (27.5 and 30.0), find the centred moving average and say which quarter it lines up with.
In one sentence, out loud: why do we use a moving average on time series data?