Smoothing Time Series
Key Terms
- Moving average
- Replaces each data value with the average of n surrounding values to reduce short-term fluctuations.
- 3-point moving average
- (yt−1 + yt + yt+1) / 3 at time t; first and last values cannot be calculated.
- Centred moving average (CMA)
- Used for even-period data (e.g. quarterly) to align the average with an actual time point.
- 4-point CMA
- Compute 4-point totals, then average pairs of consecutive 4-point totals and divide by 8.
- Purpose of smoothing
- Removes seasonal and irregular variation to reveal the underlying trend; CMA values are then used for trend-line fitting.
- Endpoints
- The first and last n/2 values (approx.) cannot have a moving average computed; they are left blank.
Why Smooth a Time Series?
Raw time series data contains trend, seasonal variation, and irregular variation all mixed together. Smoothing removes short-term fluctuations (seasonal and irregular) to make the underlying trend more visible. The main smoothing method in General Maths is the moving average.
Moving Averages
A 3-point moving average at time t = (yt−1 + yt + yt+1) ÷ 3
A 5-point moving average at time t = (yt−2 + yt−1 + yt + yt+1 + yt+2) ÷ 5
Note: the first and last few values cannot be smoothed (there are no neighbours on one side).
Centred Moving Averages (Even-Period Data)
For quarterly data (4-point) or monthly data (12-point), a simple moving average does not centre on an actual time point. We first compute a 4-point moving average, then average pairs of those to get a centred moving average (CMA) that aligns with the original time points.
Step 1: Compute 4-point totals (add 4 consecutive values).
Step 2: Add consecutive pairs of 4-point totals and divide by 8.
Worked Example — 3-Point Moving Average
Monthly sales figures: 12, 15, 18, 14, 20, 22, 19.
| Month | Sales | 3-pt MA |
|---|---|---|
| 1 | 12 | — |
| 2 | 15 | (12+15+18)÷3 = 15.0 |
| 3 | 18 | (15+18+14)÷3 = 15.7 |
| 4 | 14 | (18+14+20)÷3 = 17.3 |
| 5 | 20 | (14+20+22)÷3 = 18.7 |
| 6 | 22 | (20+22+19)÷3 = 20.3 |
| 7 | 19 | — |
The 3-point moving averages (15.0, 15.7, 17.3, 18.7, 20.3) reveal a clear upward trend that was masked by the irregular fluctuations in the raw data.
Full Lesson: Smoothing Time Series
1. The Problem with Raw Time Series Data
When we plot raw time series data, we see all four components at once: trend, seasonal variation, cyclical variation, and irregular variation. These are superimposed on each other, making the underlying trend difficult to see. For a retailer trying to decide whether overall sales are growing, the seasonal Christmas spike every December is not helpful — it masks the year-on-year growth rate. Smoothing techniques separate the signal (trend) from the noise (seasonal and irregular variation).
2. Moving Averages — The Core Idea
A moving average replaces each data value with the average of a group of values surrounding it. Because positive and negative seasonal fluctuations cancel out when averaged, the result is a smoother series that better reflects the trend.
The number of values averaged is the order of the moving average. For quarterly data, a 4-point moving average averages exactly one full year of data at a time, which completely removes any seasonal effect that repeats annually. For monthly data, a 12-point moving average serves the same purpose.
Trade-off: Higher-order moving averages are smoother but lose more data points at the ends. A 3-point MA loses 1 point at each end; a 5-point MA loses 2 points at each end.
3. Odd-Period Moving Averages (Centring Naturally)
When the order is odd (3, 5, 7, ...), each moving average value naturally centres on the middle data point. For example, the 3-point MA for Month 4 is the average of Months 3, 4, and 5. This aligns perfectly with the original data points, so no further adjustment is needed.
4. Even-Period Moving Averages and Centring
When the order is even (4, 12, ...), the moving average falls between two time points. For example, the first 4-point total for quarterly data covers Q1, Q2, Q3, Q4 — its midpoint is between Q2 and Q3, not at either. To align with the actual data, we compute a second layer of 2-point averages from the 4-point averages. This process is called centring and produces Centred Moving Averages (CMA).
The formula for the centred 4-point moving average at quarter t is:
In practice, it is computed in two steps: first compute all 4-point sums, then add consecutive pairs of sums and divide by 8.
5. Interpreting Smoothed Data
Once moving averages are computed:
- Plot the original data and the smoothed values on the same graph.
- The smoothed values show the trend direction more clearly.
- Fit a least-squares regression line to the smoothed values to model the trend mathematically.
- Use this trend line for forecasting (extended in the Forecasting lesson).
6. Choosing the Order of Moving Average
The order should match the seasonal period of the data. Quarterly data → 4-point CMA. Monthly data → 12-point CMA. Daily data with weekly seasonality → 7-point MA. If no clear seasonal period exists, 3- or 5-point MAs are common choices.
Mastery Practice
-
Fluency
The monthly sales figures ($000) for a hardware store over 7 months are: 23, 27, 31, 25, 29, 33, 28. Calculate the 3-point moving averages for all possible positions.
-
Fluency
The following data shows the quarterly rainfall (mm) for a region over two years. Calculate the 4-point moving averages.
Quarter Q1 Y1 Q2 Y1 Q3 Y1 Q4 Y1 Q1 Y2 Q2 Y2 Q3 Y2 Q4 Y2 Rainfall (mm) 120 80 40 60 130 90 50 70 -
Fluency
Using the data from Q2, calculate the centred 4-point moving averages (CMA) for all possible positions.
-
Fluency
The weekly visitor numbers to a museum over 9 weeks are: 310, 290, 330, 280, 320, 300, 340, 285, 325. Calculate the 5-point moving averages for all possible positions.
-
Understanding
The quarterly revenue ($000) for a resort over 3 years is shown below.
Year Q1 Q2 Q3 Q4 1 280 190 410 240 2 300 210 440 260 3 315 225 465 275 - Calculate the 4-point CMAs for the 10 central data points.
- What trend does the CMA reveal? Describe it.
- Why are the Q3 raw values so much higher than the CMAs for those same periods?
-
Understanding
A student computes a 3-point moving average for a dataset of 12 values.
- How many smoothed values will the student obtain?
- Why is a 3-point moving average better than a 2-point moving average for centring purposes?
- If the data has a 12-month seasonal cycle, what order moving average would best eliminate this seasonality?
-
Understanding
The following are monthly electricity bills ($) for a household over 9 months: 180, 155, 130, 110, 125, 145, 170, 190, 165.
- Calculate the 3-point moving averages.
- Describe the trend revealed by the moving averages.
- In which month does electricity use appear to reach a minimum, according to the smoothed data?
-
Understanding
A 5-point moving average is calculated for a dataset with values at time points 1 through 10. The 5-point MA at t = 5 is 42.4.
- Which five values were used to calculate this moving average?
- The values at t = 3, 4, 5, 6 are 38, 44, 40, 46. Find the value at t = 7.
-
Problem Solving
The quarterly sales data for an electrical retailer over 3 years is shown below (units: $000).
Year Q1 Q2 Q3 Q4 1 320 260 295 430 2 340 275 315 455 3 360 290 330 480 - Calculate all possible 4-point centred moving averages.
- By fitting a trend line to the CMAs (number the data quarters 1–12), estimate the trend equation ŷ = a + bt.
- Describe the trend in terms of average quarterly growth.
-
Problem Solving
A time series analyst states: “A 3-point moving average and a 5-point moving average both smooth the same dataset, but they produce different results. The 5-point MA is always the better choice.”
- Explain one advantage of a 5-point MA over a 3-point MA.
- Explain one disadvantage of a 5-point MA compared to a 3-point MA.
- Is the analyst’s conclusion that “5-point is always better” correct? Justify with reference to the purpose of smoothing.