Applied Mathematics III: Time Series and Trend
2. Measuring the Secular Trend
Four methods give the trend. Freehand: plot the series and draw a smooth line through the middle by eye; quick but subjective. Semi-averages: split the series into two equal halves, find the mean of each, plot each mean at the middle of its half and join them; the slope is the average change per year. For the six values 10, 14, 12, 18, 16, 22, the half-means are 12 and 18.67, which lie 3 years apart, so the trend rises by (18.67 − 12) ÷ 3 = 2.22 per year. Moving averages: replace each value by the mean of a window of fixed length (a 3-year moving average), which smooths out short fluctuations; the first three values give (10 + 14 + 12) ÷ 3 = 12, then (14 + 12 + 18) ÷ 3 = 14.67, (12 + 18 + 16) ÷ 3 = 15.33 and (18 + 16 + 22) ÷ 3 = 18.67. A window of length k loses k − 1 values (here two), and an odd k places each average opposite the middle year.
Four methods give the trend. Freehand: plot the series and draw a smooth line through the middle by eye; quick but subjective. Semi-averages: split the series into two equal halves, find…
3. Least Squares and Methods Compared
Least squares: fit the straight line Y = a + bX that minimises the sum of squared vertical gaps. Code the years so that the middle year is X = 0 (for an odd number of years); then a = ΣY ÷ n and b = ΣXY ÷ ΣX². For five years with sales 12, 15, 19, 22, 27 coded X = −2, −1, 0, 1, 2: ΣY = 95 so a = 19; ΣXY = −24 − 15 + 0 + 22 + 54 = 37 and ΣX² = 10 so b = 3.7. The trend line is Y = 19 + 3.7X, and the forecast for the next year (X = 3) is 19 + 11.1 = 30.1. The least-squares line is the most objective and gives a forecast; its weakness is that a straight line may not suit a curved trend.
| Method | Idea | Strength / weakness |
|---|---|---|
| Freehand | Smooth curve by eye | Simple / subjective |
| Semi-averages | Two half-means joined | Easy, gives a rate / sensitive to extreme values |
| Moving average | Mean of a window slides along | Smooths / loses end values, no forecast |
| Least squares | Best-fit straight line | Objective, forecasts / assumes a straight line |
Least squares: fit the straight line Y = a + bX that minimises the sum of squared vertical gaps. Code the years so that the middle year is X = 0 (for an odd number of years); then a = ΣY ÷…
4. Worked Examples
Example 1. Ice-cream sales peak every June and fall every January, year after year: that is seasonal variation. Example 2. Sales that grow steadily from 12 to 27 over five years, apart from small bumps: the long-term movement is the trend, and the bumps are irregular. Example 3. A factory's output falls for two years after a fire and then recovers: the fall is irregular (a one-off event), not cyclical, as a cycle is a recurring wave of more than a year. Example 4. Using the trend Y = 19 + 3.7X, the forecast for X = 4, two years ahead, is 19 + 14.8 = 33.8; forecasts far beyond the data are less reliable because the trend may change. Example 5. A 3-year moving average of the series 10, 14, 12, 18, 16, 22 has four values, so the series has lost 3 − 1 = 2 values at the ends.
Example 1. Ice-cream sales peak every June and fall every January, year after year: that is seasonal variation. Example 2. Sales that grow steadily from 12 to 27 over five years, apart from…
5. More Worked Problems: Moving Average and Least-Squares Trend
A three-year moving average for the series 10, 12, 14, 13, 17, 19 is found by averaging each run of three consecutive values: (10 + 12 + 14)/3 = 12, (12 + 14 + 13)/3 = 13, (14 + 13 + 17)/3 = 14.67 and (13 + 17 + 19)/3 = 16.33. Each average is placed against the middle year of its run, so four values are obtained from six and the first and last years are lost. For the least-squares line, code the years about the middle one: for five years with sales 12, 14, 17, 19 and 23, take x = −2, −1, 0, 1, 2. Because Σx = 0, a = ΣY/n = 85/5 = 17 and b = ΣxY/Σx² = 27/10 = 2.7, so the trend is Y = 17 + 2.7x and the forecast for the next year, x = 3, is 17 + 8.1 = 25.1.
- Sales 12, 14, 17, 19, 23
- Code years x = −2, −1, 0, 1, 2So Σx = 0
- a = ΣY/n = 85/5 = 17
- b = ΣxY/Σx² = 27/10 = 2.7
- Trend Y = 17 + 2.7x
- Forecast at x = 3: 25.1
A three-year moving average for the series 10, 12, 14, 13, 17, 19 is found by averaging each run of three consecutive values: (10 + 12 + 14)/3 = 12, (12 + 14 + 13)/3 = 13, (14 + 13 + 17)/3…
Key takeaways
- A time series is data recorded in time order; its components are trend, seasonal, cyclical and irregular.
- The additive model is Y = T + S + C + I and the multiplicative model Y = T × S × C × I.
- Trend methods are freehand, semi-averages, moving averages and least squares.
- A k-year moving average loses k − 1 values; least squares gives Y = a + bX with a = ΣY ÷ n and b = ΣXY ÷ ΣX² when X is coded from the middle year.
Practice questions (24)
Attempt each one before opening the answer. Every explanation names the tempting wrong option as well as the right one, because that is where marks are lost.
Woollen clothes sell more every winter. This is which component of a time series?
Show answer
Answer: B — Seasonal
A pattern that repeats within every year is seasonal variation.The multiplicative model of a time series is:
Show answer
Answer: A — Y = T × S × C × I
The four components are multiplied in the multiplicative model and added in the additive one.A 3-year moving average of the six values 10, 14, 12, 18, 16, 22 gives how many averages?
Show answer
Answer: D — 4
A window of 3 loses 3 − 1 = 2 values, so 6 − 2 = 4 averages remain.
Show the other 21 questions
Which method of measuring trend is the most objective and allows forecasting?
Show answer
Answer: C — Least squares
Least squares fits a line by a fixed rule and gives a trend equation, so no judgement by eye is needed.The first 3-year moving average of the series 10, 14, 12, 18 is:
Show answer
Answer: B — 12
(10 + 14 + 12) ÷ 3 = 36 ÷ 3 = 12, placed against the middle year.Sales for five years, coded X = −2 to 2, are 12, 15, 19, 22 and 27. The least-squares slope b is:
Show answer
Answer: A — 3.7
b = ΣXY ÷ ΣX² = 37 ÷ 10 = 3.7. The intercept a = ΣY ÷ n = 19, and 37 is only the numerator.With the trend Y = 19 + 3.7X, the forecast for X = 3 is:
Show answer
Answer: D — 30.1
19 + 3.7 × 3 = 19 + 11.1 = 30.1. The value 33.8 would be X = 4.Which is a cyclical variation?
Show answer
Answer: C — Alternating boom and recession over several years
A recurring wave of more than one year is cyclical. The others are seasonal, irregular and trend.For the series 10, 14, 12, 18, 16, 22 the semi-average method gives a yearly trend increase of about:
Show answer
Answer: B — 2.22
The half-means are 12 and 18.67, three years apart, so the slope is 6.67 ÷ 3 = 2.22. Giving 6.67 forgets to divide by the three-year gap.Statement 1: A 5-year moving average loses four values. Statement 2: Least squares gives no way to forecast. Which is correct?
Show answer
Answer: A — Only statement 1
A window of k loses k − 1 values, so statement 1 is true. Statement 2 is false: least squares gives a trend equation that is used for forecasts.A sudden flood destroys the crop and output falls sharply in one year only. This is which component of a time series?
Show answer
Answer: C — Irregular variation
A one-off, unpredictable event such as a flood is an irregular (random) variation. Cyclical variation is the tempting wrong option, but cycles recur over several years in business conditions and are not caused by a single shock.The smooth long-term rise or fall of a series over many years is called the:
Show answer
Answer: D — Secular trend
Secular trend is the underlying long-run direction of the data. Cyclical variation is the tempting wrong option because it also lasts for years, but it is an up-and-down wave around the trend, not the trend itself.Sales for five years are 10, 20, 30, 40 and 50, coded X = −2, −1, 0, 1, 2. In the least-squares line Y = a + bX, the value of a is:
Show answer
Answer: A — 30
Because ΣX = 0, a = ΣY ÷ n = 150 ÷ 5 = 30, the mean of the sales. 150 is the tempting wrong option, the total ΣY, which has not been divided by n = 5.The 3-year moving averages of the series 5, 8, 11, 8, 14 are computed. The third moving average is:
Show answer
Answer: B — 11
The third average uses the last three values: (11 + 8 + 14) ÷ 3 = 11. 8 is the tempting wrong option, the first moving average (5 + 8 + 11) ÷ 3; the second is (8 + 11 + 8) ÷ 3 = 9.Sales for 2019 to 2023 are 8, 10, 14, 16 and 22 (₹ lakh), coded X = −2 to 2 with 2021 as origin. The least-squares slope b is:
Show answer
Answer: C — 3.4
ΣXY = −16 − 10 + 0 + 16 + 44 = 34 and ΣX² = 10, so b = 34 ÷ 10 = 3.4. 34 is the tempting wrong option, ΣXY itself, forgetting to divide by ΣX²; 14 is a = ΣY ÷ 5, the intercept.For the same data the trend line is Y = 14 + 3.4X with X = 0 in 2021 and X in years. The trend forecast for 2025 is:
Show answer
Answer: D — 27.6
2025 is four years after the origin, so X = 4 and Y = 14 + 3.4 × 4 = 27.6. 24.2 is the tempting wrong option, which uses X = 3 and so forecasts 2024; 31.0 uses X = 5, which is 2026.A 5-year moving average is applied to a series of 12 yearly values. The number of trend values obtained is:
Show answer
Answer: A — 8
Each average needs 5 consecutive values, so the count is 12 − 5 + 1 = 8, with two values lost at each end. 7 is the tempting wrong option, from subtracting 5 without adding back 1.Yearly sales for six years are 20, 24, 28, 36, 42, 48. By the semi-average method the trend rises each year by:
Show answer
Answer: B — 6
The semi-averages are 24 and 42 and they fall in the middle years of each half, 3 years apart, so the yearly rise is (42 − 24) ÷ 3 = 6. 18 is the tempting wrong option, the difference of the semi-averages not divided by the 3 years between their mid-points.A trend line is Y = 20 + 4X with the origin at 2021. If the origin is shifted to 2023 (X′ = X − 2), the equation becomes:
Show answer
Answer: C — Y = 28 + 4X′
Since X = X′ + 2, Y = 20 + 4(X′ + 2) = 28 + 4X′: the slope is unchanged and the intercept becomes the trend value of the new origin year 2023. Y = 20 + 4X′ is the tempting wrong option, which leaves the intercept as it was; 12 comes from moving the origin the wrong way.In the additive model Y = T + S + C + I, an observation is Y = 120 with T = 100, S = +12 and I = +3. The cyclical component C is:
Show answer
Answer: D — 5
C = Y − T − S − I = 120 − 100 − 12 − 3 = 5. 8 is the tempting wrong option, from forgetting to subtract I; 17 forgets S; 20 is just Y − T, which still contains all of S, C and I.For the yearly series 12, 16, 14, 18, 20, 22 the 4-year centred moving average that falls at the third year is:
Show answer
Answer: A — 16
The 4-year totals are 60 (years 1–4) and 68 (years 2–5); these fall between years, so the centred value at year 3 is (60 + 68) ÷ 8 = 16. 15 is the tempting wrong option, the uncentred average 60 ÷ 4 which sits between years 2 and 3; 17 is 68 ÷ 4 between years 3 and 4.Sales for four years 2020–2023 are 10, 14, 18, 26. Coded with X = −3, −1, 1, 3 (half-year units from the middle of the series), the yearly increase in trend is:
Show answer
Answer: B — 5.2
ΣXY = −30 − 14 + 18 + 78 = 52 and ΣX² = 20, so b = 2.6 per half-year, and one year is two units of X, giving 5.2 a year. 2.6 is the tempting wrong option, the slope per half-year used as if it were per year; 17 is the intercept ΣY ÷ 4.A least-squares line Y = 9 + 2.3X is fitted to the coded data X = −2, −1, 0, 1, 2 and Y = 4, 7, 9, 12, 13. The sum of squared deviations of Y from the line is:
Show answer
Answer: C — 1.10
The fitted values are 4.4, 6.7, 9, 11.3, 13.6, so the deviations are −0.4, 0.3, 0, 0.7, −0.6 and the squares add to 0.16 + 0.09 + 0 + 0.49 + 0.36 = 1.10. 0 is the tempting wrong option: the plain sum of the deviations is 0 for a least-squares line, but the sum of their squares, which is what is minimised, is not.Consider these statements about time series.
(1) Cyclical variations repeat exactly every 12 months.
(2) Irregular variations follow no regular pattern and cannot be forecast.
(3) A moving average whose period equals the length of a regular cycle removes that cycle from the series.Show answer
Answer: C — 2 and 3 only
Statement 1 is false: a repeat every 12 months is seasonal variation, while cyclical variation spans several years and has no exact period. Statements 2 and 3 are true. "1, 2 and 3" is the tempting wrong option, from accepting the loose use of the word cycle in statement 1.