Resources For Teachers For Tutors For Students & Parents AI New Books Pricing
Year 12 Maths - General (Unit 3 & Unit 4) Investigating and modelling time series data

Smoothing with moving means

20 practice questions 0 video lessons Theory + worked examples

Find out how moving means smooth a bumpy time series in Year 12 VCE General Mathematics. Weekly ticket sales at a Bendigo theatre or monthly output at a Shepparton cannery jump about from one period to the next. Replacing each value with the mean of its neighbours cuts through that noise so the real direction is easier to see.

You will practise 3-mean and 5-mean smoothing, placing each value at the middle period, and learn why an even number of terms needs centring: averaging two neighbouring means. You will see how a 4-mean for quarterly data or a 12-mean for monthly data wipes out the seasonal pattern, before moving on to smoothing a plot with moving medians.

Create a free accountTrack your progress and save your work as you go.
Create free account

Theory

Moving means smooth out the large ups and downs in a time series so the trend stands out. This Year 12 General Mathematics guide for students in Victoria shows how to calculate 3-mean and 5-mean smoothed values, how centring works for 2-, 4- and 12-mean smoothing, and how to choose the number of terms.

A time series with large ups and downs can hide its long-term direction. Smoothing replaces each value with the mean of a group of neighbouring values, so the irregular fluctuations shrink and the trend is easier to see.

In 3-mean smoothing the smoothed value for a period is the mean of that value and the one on each side; 5-mean smoothing uses two on each side. An odd number of terms has a middle period, so the smoothed value is placed there. The group then moves along one period at a time. The first and last few periods have no smoothed value, because a full group does not fit.

With an even number of terms (\(2\), \(4\) or \(12\)) the mean falls halfway between two periods. Centring fixes this: average two adjacent even-term means, and the result sits exactly on a period. A 4-mean with centring for quarterly data, or a 12-mean with centring for monthly data, contains one of every season, so it also removes the seasonality.

Key idea. Odd number of terms: place the mean at the middle period. Even number of terms: find two adjacent means, then average them to centre the smoothed value on a period. More terms give a smoother series.
Weekly orders with 3-mean smoothingTen weekly values that zig-zag up and down (solid), with the 3-mean smoothed values from week 2 to week 9 (dashed), which rise every week 40 45 50 55 60 65 1 2 3 4 5 6 7 8 9 10 Week Orders
Solid: the raw weekly orders. Dashed: the 3-mean smoothed values, each placed at the middle week of its three. Smoothing removes the zig-zag and shows a steady increasing trend. Weeks \(1\) and \(10\) have no smoothed value.
Quarterly visitors with 4-mean smoothing with centringTwelve quarterly values that peak every Q1 and dip every Q3 (solid); the centred 4-mean smoothed values from Q3 2022 to Q2 2024 (dashed) form a straight rising line 70 90 110 130 150 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 2022 2023 2024 Visitors (hundreds)
Each 4-mean contains one Q1, Q2, Q3 and Q4, so the seasonal highs and lows cancel. After centring, the smoothed values (dashed) sit on Q3 \(2022\) to Q2 \(2024\) and show the trend alone: up \(2\) hundred every quarter.

With \(y_t\) the value at period \(t\), the smoothed values placed at period \(t\) are:

\[\text{3-mean} = \dfrac{y_{t-1} + y_t + y_{t+1}}{3} \qquad \text{5-mean} = \dfrac{y_{t-2} + y_{t-1} + y_t + y_{t+1} + y_{t+2}}{5}\]
3-mean=yt−1+yt+yt+13

Centring a 4-mean on period \(t\): the first 4-mean (periods \(t-2\) to \(t+1\)) sits halfway between \(t-1\) and \(t\); the second (periods \(t-1\) to \(t+2\)) sits halfway between \(t\) and \(t+1\). Their mean sits on \(t\):

\[\text{centred value} = \dfrac{\text{first 4-mean} + \text{second 4-mean}}{2}\]
centred value=mean1+mean22

The same idea works for 2-means and 12-means. With \(n\) values:

SmoothingNumber of smoothed valuesExample: \(n = 12\)
\(k\)-mean, \(k\) odd\(n - k + 1\)3-mean: \(10\); 5-mean: \(8\)
\(k\)-mean with centring, \(k\) even\(n - k\)2-mean: \(10\); 4-mean: \(8\)
Choosing the number of terms. For data with seasonality, use as many terms as there are seasons: a 4-mean with centring for quarterly data, a 12-mean with centring for monthly data, a 7-mean for daily data with a weekly pattern.

Odd number of terms (3-mean, 5-mean)

  1. Pick the group. For period \(t\), use \(t-1\), \(t\), \(t+1\) (3-mean) or \(t-2\) to \(t+2\) (5-mean).
  2. Add and divide by the number of terms.
  3. Place the answer at the middle period, then slide the group on one period and repeat.

Even number of terms, with centring (2-mean, 4-mean, 12-mean)

  1. Find the two means that straddle period \(t\). For a 4-mean: periods \(t-2\) to \(t+1\), and periods \(t-1\) to \(t+2\).
  2. Average the two means. The result is the smoothed value with centring for period \(t\).
  3. Interpret the smoothed series: describe the trend it shows, now that the fluctuations (and, with the right number of terms, the seasonality) are removed.
Example 1 β€” 3-mean and 5-mean smoothing
The yearly number of visitors (thousand) to a Grampians lookout is shown.
Year2018201920202021202220232024
Visitors (thousand)52615566597268
(i) Find the 3-mean smoothed values for \(2019\) and \(2021\). (ii) Find the 5-mean smoothed value for \(2020\). (iii) How many 3-mean and how many 5-mean smoothed values can be found? Describe the trend shown by the 3-mean smoothed values.
Solution

A 3-mean uses the year and one year each side; a 5-mean uses two years each side.

\(\text{3-mean (2019)}\)\(=\)\(\dfrac{52 + 61 + 55}{3}\)
\(\text{3-mean (2019)}\)\(=\)\(\dfrac{168}{3}\)
\(\text{3-mean (2019)}\)\(=\)\(56\)
\(\text{3-mean (2021)}\)\(=\)\(\dfrac{55 + 66 + 59}{3}\)
\(\text{3-mean (2021)}\)\(=\)\(\dfrac{180}{3}\)
\(\text{3-mean (2021)}\)\(=\)\(60\)
\(\text{5-mean (2020)}\)\(=\)\(\dfrac{52 + 61 + 55 + 66 + 59}{5}\)
\(\text{5-mean (2020)}\)\(=\)\(\dfrac{293}{5}\)
\(\text{5-mean (2020)}\)\(=\)\(58.6\)
\(\text{number of 3-means}\)\(=\)\(7 - 3 + 1 = 5\)
\(\text{number of 5-means}\)\(=\)\(7 - 5 + 1 = 3\)

(i) \(56\) and \(60\) thousand. (ii) \(58.6\) thousand. (iii) \(5\) three-mean values (\(2019\) to \(2023\)) and \(3\) five-mean values (\(2020\) to \(2022\)). All the 3-mean smoothed values, correct to one decimal place:

Year20192020202120222023
3-mean\(56\)\(60.7\)\(60\)\(65.7\)\(66.3\)
Example 1: yearly visitors and the 3-mean smoothed valuesSeven yearly values that zig-zag (solid) and five 3-mean smoothed values for 2019 to 2023 (dashed), which rise more steadily 50 55 60 65 70 75 2018 2019 2020 2021 2022 2023 2024 Visitors (thousand)

The smoothed values rise overall from \(56\) to \(66.3\): an increasing trend.

Example 2 β€” 2-mean smoothing with centring
The number of tickets (tens) sold each week by a Bendigo theatre is shown.
Week12345
Tickets (tens)6270748078
Find the 2-mean smoothed value with centring for week \(3\).
Solution

Each 2-mean sits halfway between two weeks; average the 2-means on either side of week \(3\).

\(\text{weeks 2 and 3}\)\(:\)\(\dfrac{70 + 74}{2} = 72\)
\(\text{weeks 3 and 4}\)\(:\)\(\dfrac{74 + 80}{2} = 77\)
\(\text{centred (week 3)}\)\(=\)\(\dfrac{72 + 77}{2}\)
\(\text{centred (week 3)}\)\(=\)\(74.5\)

The 2-mean smoothed value with centring for week \(3\) is \(74.5\) tens. (Check: it equals \(\dfrac{70 + 2 \times 74 + 80}{4}\), because the middle week is counted twice.)

Example 3 β€” 4-mean smoothing with centring
The quarterly sales (\(\$\) thousand) of a Mornington Peninsula winery are shown. (Q1 = January to March, Q2 = April to June, Q3 = July to September, Q4 = October to December.)
YearQ1Q2Q3Q4
202315011896132
2024158122104140
(i) Find the 4-mean smoothed values with centring for Q3 \(2023\) and Q4 \(2023\). (ii) The actual sales rise and fall each year. Explain why the smoothed values do not, and describe the trend.
Solution

Find adjacent 4-means, then average each pair.

\(\text{Q1 to Q4 2023}\)\(:\)\(\dfrac{496}{4} = 124\)
\(\text{Q2 2023 to Q1 2024}\)\(:\)\(\dfrac{504}{4} = 126\)
\(\text{centred (Q3 2023)}\)\(=\)\(\dfrac{124 + 126}{2}\)
\(\text{centred (Q3 2023)}\)\(=\)\(125\)
\(\text{Q3 2023 to Q2 2024}\)\(:\)\(\dfrac{508}{4} = 127\)
\(\text{centred (Q4 2023)}\)\(=\)\(\dfrac{126 + 127}{2}\)
\(\text{centred (Q4 2023)}\)\(=\)\(126.5\)
Example 3: quarterly sales with 4-mean smoothing with centringEight quarterly values that peak in Q1 and dip in Q3 (solid); the four centred 4-mean smoothed values from Q3 2023 to Q2 2024 (dashed) rise steadily from 125 to 130 90 110 130 150 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 2023 2024 Sales ($ thousand)

(i) \(125\) and \(126.5\) (\(\$\) thousand). (ii) Every 4-mean contains one of each quarter, so the busy Q1 and quiet Q3 cancel out. The smoothed values (\(125,\ 126.5,\ 128,\ 130\)) rise steadily: an increasing trend.

Example 4 β€” 12-mean smoothing with centring
A Shepparton cannery smooths its monthly output (thousand tonnes) with a 12-mean with centring. The 12-mean of January to December \(2024\) is \(38.4\), and the 12-mean of February \(2024\) to January \(2025\) is \(39.0\). (i) Find the smoothed value with centring and the month where it is placed. (ii) The cannery has \(36\) months of data. How many 12-mean smoothed values with centring can be found?
Solution

The middle of months \(1\) to \(12\) is \(6.5\), halfway between June and July.

\(\text{Jan to Dec}\)\(:\)\(\text{sits between June and July}\)
\(\text{Feb to Jan}\)\(:\)\(\text{sits between July and August}\)
\(\text{centred value}\)\(=\)\(\dfrac{38.4 + 39.0}{2}\)
\(\text{centred value}\)\(=\)\(38.7\)
\(\text{number of 12-means}\)\(=\)\(36 - 12 + 1 = 25\)
\(\text{centred values}\)\(=\)\(25 - 1 = 24\)

(i) \(38.7\) thousand tonnes, placed at July \(2024\). (ii) \(24\) centred values (\(36 - 12\)); the first six and last six months have none.

Common pitfalls

Centre every even-term mean. A single 4-mean of Q1 to Q4 belongs between Q2 and Q3, not at either one. Average it with the next 4-mean to place a value on Q3.
Place odd-term means at the middle period. The 3-mean of weeks \(4\), \(5\) and \(6\) belongs to week \(5\). Plot it there too.
Do not invent end values. With 5-mean smoothing the first two and last two periods have no smoothed value; with a 4-mean with centring the same is true.

Frequently asked questions

Why do we smooth a time series?

Smoothing averages out the large short-term ups and downs so that the long-term trend is easier to see and describe.

How do I calculate a 3-mean smoothed value?

Add the value for the period and the values just before and just after it, divide by 3, and place the answer at that middle period. Then move along one period and repeat.

What does centring mean in moving mean smoothing?

With an even number of terms, such as 4, the mean sits halfway between two time periods. Centring averages two adjacent means so that the smoothed value sits exactly on a time period.

How do I find a 4-mean smoothed value with centring?

Find the mean of the four values from two periods before to one period after, and the mean of the four values from one period before to two periods after. The average of these two 4-means is the centred value.

Why use a 4-mean for quarterly data or a 12-mean for monthly data?

Each group then contains exactly one of every season, so the seasonal highs and lows cancel out and only the trend is left.

How many smoothed values will I get?

With n values, odd k-mean smoothing gives n - k + 1 values and even k-mean smoothing with centring gives n - k values. For 12 quarterly values, 4-mean smoothing with centring gives 8.