Unit 3 · Data Analysis

📉 Time Series & Moving Averages

Data over time looks messy, seasonal ups and downs hide the real trend. Moving averages smooth out the noise so you can see what's actually happening. A key skill for seasonal indices too.

What even is this?

A time series is any data collected at regular time intervals, weekly sales, quarterly visitors, monthly rainfall. The raw data bounces around because of seasons, random events, and underlying trends all happening at once.

A moving average smooths that bouncing by replacing each point with an average of the nearby values. What's left is the trend, the real story.

If you only do one thing Plot value against time, then smooth the bumps with moving averages to see the underlying trend.

The 10-minute version

Low energy? Do just this and you have still won the day. Zero is the only fail.

The one move: read the first formula box and the first worked example above, then do Practice Question 1. Screenshot the win for Nat and stop there.

📺 Watch it explained

Four short ways in. The 🎬 cards are waiting on Nat's videos, and each has a ready-to-read film script tucked underneath. 🖨️ Prefer printable notes? 4 styles here.

1
Components of a Time Series

Any time series can be broken into three overlapping components:

📈

Trend

The long-term direction, is it generally going up, down, or staying flat? The trend ignores short-term bumps.

🌀

Seasonal Variation

A repeating pattern linked to the calendar, e.g. ice cream sales always spike in summer and dip in winter, every year.

Irregular Fluctuation

Random noise, one-off events like a storm, a viral post, or a competitor closing that can't be predicted.

💡 The goal of a moving average: remove the seasonal and irregular components so the trend stands alone and is easy to see.
2
Time Series Graph, What to Look For

A time series graph puts time on the x-axis and the measured value on the y-axis. Points are plotted and joined with a line. Here's what the two lines mean:

Time → High Low Q1 Q2 Q3 Q4 Q5 Q6 Q7 Q8 ↗ Trend
Raw time series (jagged, seasonal)
Moving average (smooth trend)
✏️ Describe the graph: When asked to describe a time series, comment on the trend (increasing/decreasing/stable) and any seasonal pattern (e.g. "peaks each summer quarter"). Both components score marks.
3
Calculating a Moving Average

An n-point moving average replaces each data point with the mean of n consecutive values centred on that point. The window of n values "moves" along the dataset one step at a time.

🔵 Odd-numbered (3-pt, 5-pt)

A 3-point MA at time t = average of values at t−1, t, and t+1.

The result sits directly at time t, no centering needed.

Common in monthly data.

🟣 Even-numbered (4-pt)

A 4-point MA sits between two time points, it needs an extra step called centering to align with the original data.

Common in quarterly data (4 seasons).

4
3-Point Moving Average, Step by Step

Monthly visitors to a café (in hundreds): Jan=100, Feb=110, Mar=108, Apr=118, May=116, Jun=126

3-pt MA at time t = (valuet−1 + valuet + valuet+1) ÷ 3
Month Visitors Calculation 3-pt MA
Jan100 , ,
Feb110 (100 + 110 + 108) ÷ 3 106.0
Mar108 (110 + 108 + 118) ÷ 3 112.0
Apr118 (108 + 118 + 116) ÷ 3 114.0
May116 (118 + 116 + 126) ÷ 3 120.0
Jun126 , ,
📌 No MA for first or last values, you can't average "before" Jan or "after" Jun, so those rows stay blank. For a dataset of n values, a 3-point MA produces n−2 results.

The MAs (106 → 112 → 114 → 120) clearly show an increasing trend, even though the raw data bounces up and down.

5
4-Point Moving Average & Centering

Quarterly data has 4 seasons, so a 4-point MA is used. The issue: a 4-point average of Q1, Q4 sits between Q2 and Q3, not at any actual time point. We fix this by centering, averaging pairs of consecutive 4-pt MAs so they line up with the original quarters.

Step 1: Calculate each 4-point moving average (averages of 4 consecutive values).
Step 2: Center them, average each consecutive pair of 4-pt MAs. This gives centred moving averages (CMA) that align with actual quarters.

Example dataset · quarterly café visitors (hundreds): Q1=12, Q2=8, Q3=6, Q4=10, Q5=14, Q6=10, Q7=8, Q8=12

Quarter Visitors 4-pt MA Centred MA
Q112, ,
Q28, ,
Q36 9.0 & 9.5* 9.25
Q410 9.5 & 10.0* 9.75
Q514 10.0 & 10.5* 10.25
Q610 10.5 & 11.0* 10.75
Q78, ,
Q812, ,

* The two 4-pt MA values used to centre at each quarter. e.g. at Q3: MA(Q1, Q4)=9.0 and MA(Q2, Q5)=9.5, so CMA = (9.0+9.5)÷2 = 9.25.

💡 Reading the trend: The centred MAs (9.25 → 9.75 → 10.25 → 10.75) increase by 0.5 each quarter. This tells us there is a consistent upward trend of approximately 0.5 hundred visitors per quarter, after removing seasonal effects.
6
Worked Example, Full Solution
Coastal Café, Quarterly Sales Analysis
Quarterly sales over 2 years (in $thousands). Find the 4-pt centred MAs and describe the trend.

Data: Q1=80, Q2=60, Q3=50, Q4=70, Q5=90, Q6=70, Q7=60, Q8=80 (all $thousands)

1

Calculate the 4-point moving averages

MA(Q1, Q4) = (80+60+50+70)÷4 = 260÷4 = 65.0
MA(Q2, Q5) = (60+50+70+90)÷4 = 270÷4 = 67.5
MA(Q3, Q6) = (50+70+90+70)÷4 = 280÷4 = 70.0
MA(Q4, Q7) = (70+90+70+60)÷4 = 290÷4 = 72.5
MA(Q5, Q8) = (90+70+60+80)÷4 = 300÷4 = 75.0

2

Centre the moving averages (average consecutive pairs)

CMA at Q3 = (65.0 + 67.5) ÷ 2 = 66.25
CMA at Q4 = (67.5 + 70.0) ÷ 2 = 68.75
CMA at Q5 = (70.0 + 72.5) ÷ 2 = 71.25
CMA at Q6 = (72.5 + 75.0) ÷ 2 = 73.75

3

Describe the trend

The centred MAs increase from 66.25 to 73.75 over 4 quarters, an increase of about 2.5 per quarter.

The trend is increasing. After removing seasonal variation, the café's quarterly sales are growing by approximately $2,500 per quarter.
4

Describe the seasonal pattern

Looking at the raw data: sales peak in Q1 & Q5 (summer), drop to lows in Q3 & Q7 (winter). A repeating seasonal pattern is visible with a period of 4 quarters.

7
Practice Questions

Tap to reveal the answer. Try it yourself first!

1
A time series shows monthly sales: Jan=200, Feb=240, Mar=220, Apr=260, May=240, Jun=280. Calculate the 3-point moving average for March.
Tap to reveal ▾
3-pt MA at March = (Feb + Mar + Apr) ÷ 3 = (240 + 220 + 260) ÷ 3 = 720 ÷ 3 = 240

The 3-pt MA at any middle point uses the value before it, itself, and the value after. Don't forget: there is no MA for January (first) or June (last), you need a value on each side.
2
Quarterly data: Q1=20, Q2=30, Q3=25, Q4=35, Q5=30. Calculate the 4-point moving average for the window Q1, Q4, then Q2, Q5.
Tap to reveal ▾
MA(Q1, Q4) = (20+30+25+35) ÷ 4 = 110 ÷ 4 = 27.5
MA(Q2, Q5) = (30+25+35+30) ÷ 4 = 120 ÷ 4 = 30.0

These two averages sit between the quarters they average, which is why we need to centre them in the next step.
3
Using the two 4-pt MAs from Question 2 (27.5 and 30.0), calculate the centred moving average. Which quarter does this CMA align with?
Tap to reveal ▾
CMA = (27.5 + 30.0) ÷ 2 = 57.5 ÷ 2 = 28.75

MA(Q1, Q4) sits between Q2 and Q3. MA(Q2, Q5) sits between Q3 and Q4. Averaging them gives a value that aligns exactly at Q3. Centering always gives you a CMA that sits at the middle quarter of the two windows combined.
4
A time series graph for a surf shop shows these centred moving averages over 2 years: Q3(Yr1)=42, Q4(Yr1)=45, Q1(Yr2)=48, Q2(Yr2)=51. Describe the trend.
Tap to reveal ▾
The trend is increasing.

The centred moving averages increase by 3 each quarter (42, 45, 48, 51, an arithmetic sequence with common difference 3). After removing seasonal variation, the surf shop's sales are consistently rising by about 3 units per quarter. You could also say: "The underlying trend shows consistent growth of approximately 3 units per quarter."
5
A student calculates these 4-pt centred MAs: 88, 86, 84, 82. They say "sales are going well, there's a strong trend." Are they right? What does the trend actually show?
Tap to reveal ▾
The student is wrong. The CMA values are decreasing (88 → 86 → 84 → 82), which means the trend is downward, sales are declining by 2 units per period after removing seasonal variation.

This is a trap! The raw data might sometimes hit high values (due to seasonal peaks) but the underlying trend is clearly falling. The CMAs are what you use to identify the true trend, not the raw highs.
Ready to practise?
Second Cup, Escape Room
6 challenges: 4-point moving averages, centring, trend identification, and predicting the next MA in the sequence. Help Maria decide whether to open a second café.
Play →