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

Trend lines and forecasting

20 practice questions 0 video lessons Theory + worked examples

Use trend lines to look ahead in Year 12 VCE General Mathematics. Councils planning school places in Melbourne's growing west and tourism operators in Mildura budgeting for next summer all need a sensible forecast, and a least squares line through a time series gives one: \(y = a + bt\), where \(t\) counts the time periods.

You will practise numbering time periods, fitting the line with technology, interpreting the slope as the average change per period, and making forecasts. For seasonal data you will fit the line to deseasonalised values and then multiply by the seasonal index, and you will learn why a forecast far into the future can go badly wrong.

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

Theory

A least squares trend line \(y = a + bt\) models the long-term direction of a time series. This Year 12 General Mathematics guide for students in Victoria shows how to fit it with technology, interpret the slope and intercept, make forecasts (re-seasonalising seasonal data) and recognise the limits of extrapolating.

To model the long-term trend in a time series, number the time periods \(t = 1, 2, 3, \ldots\) in order and fit a least squares line in which time \(t\) is the explanatory variable and the data value is the response variable. Always state what \(t = 1\) stands for (for example, \(t = 1\) is Q1 \(2023\)).

The trend line is written \(y = a + bt\). The slope \(b\) is the average change in the data per time period, and the intercept \(a\) is the value the line gives at \(t = 0\), the period just before the data start. Find \(a\) and \(b\) with technology, entering \(t\) as the explanatory variable.

A forecast is made by substituting a future value of \(t\). If the data are seasonal, first deseasonalise them, fit the line to the deseasonalised values, forecast, and then re-seasonalise by multiplying by the seasonal index. Forecasting beyond the data is extrapolation: it assumes the linear trend continues, so it is only reliable a short way ahead.

Key idea. Trend line \(y = a + bt\), with \(t\) the time period. For seasonal data: forecast \(= (a + bt) \times \text{seasonal index}\), where the line was fitted to the deseasonalised data.
Least squares trend line extended to a forecastEight yearly values from 2017 to 2024 with a dashed least squares trend line that continues to 2026, where a ringed point shows the forecast 120 140 160 180 2017 2019 2021 2023 2025 2027 Members (hundreds)
The least squares trend line \(y = 120.64 + 5.19t\) (\(t = 1\) is \(2017\)) continued to \(2026\) (\(t = 10\)); the ringed point is the forecast. Anything past the data is extrapolation.
Trend line fitted to deseasonalised quarterly dataEight deseasonalised quarterly values for 2023 and 2024 with a dashed least squares trend line continued through 2025 80 85 90 95 100 105 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 2023 2024 2025 Deseasonalised sales
For seasonal data the trend line \(y = 82.11 + 1.81t\) is fitted to the deseasonalised values (\(t = 1\) is Q1 \(2023\)). A forecast from it is then multiplied by the seasonal index.

The least squares trend line, with time period \(t\) as the explanatory variable:

\[y = a + bt\]
y=a+bt

What the calculator works out (\(\bar{t}\), \(\bar{y}\) are the means, \(s_t\), \(s_y\) the standard deviations and \(r\) the correlation coefficient):

\[b = r\,\dfrac{s_y}{s_t} = \dfrac{S_{ty}}{S_{tt}}, \qquad a = \bar{y} - b\,\bar{t}\]
b=rsyst,a=y¯−bt¯

Forecasting seasonal data from a trend line fitted to the deseasonalised values:

\[\text{forecast} = (a + bt) \times \text{seasonal index}\]
forecast=(a+bt)×seasonal index

Finding \(t\) for a future period (\(t = 1\) is the first period):

Data\(t\) for the period
yearly, \(t = 1\) is year \(Y_1\)year \(- Y_1 + 1\)
quarterly, \(t = 1\) is Q1 of year \(Y_1\)\(4 \times (\text{year} - Y_1) + \text{quarter number}\)
monthly, \(t = 1\) is January of year \(Y_1\)\(12 \times (\text{year} - Y_1) + \text{month number}\)

Fitting and using a trend line

  1. Number the periods \(t = 1, 2, 3, \ldots\) and say what \(t = 1\) is.
  2. Remove the season if needed. For seasonal data, deseasonalise first: actual \(\div\) seasonal index.
  3. Fit the line with technology, \(t\) as the explanatory variable. Write \(y = a + bt\) in words for the context, with \(a\) and \(b\) usually to \(2\) decimal places.
  4. Interpret: the slope is the average change per period; the intercept is the trend value at \(t = 0\).
  5. Forecast: find \(t\) for the future period and substitute. For seasonal data, multiply the result by that season's index (re-seasonalise).
  6. Judge the limitations: a forecast is more trustworthy when the points follow a straight line closely, the forecast is only a short way past the data, and nothing suggests the trend will change. A forecast far ahead can even give an impossible value.
Example 1 β€” Interpret a trend line and forecast
The number of students at a growing school in Melbourne's west is modelled by the trend line \(\text{students} = 386 + 12.5 \times t\), where \(t = 1\) is \(2019\). (i) Interpret the slope. (ii) Interpret the intercept. (iii) Forecast the number of students in \(2027\).
Solution

Find the value of \(t\) for \(2027\), then substitute.

(i) On average, the number of students increases by \(12.5\) each year. (ii) At \(t = 0\) (\(2018\)) the trend line gives \(386\) students.

\(t\)\(=\)\(2027 - 2019 + 1\)
\(t\)\(=\)\(9\)
\(\text{students}\)\(=\)\(386 + 12.5 \times 9\)
\(\text{students}\)\(=\)\(386 + 112.5\)
\(\text{students}\)\(=\)\(498.5\)

(iii) About \(499\) students in \(2027\) (the model gives \(498.5\)).

Example 2 β€” The limits of extrapolation
The number of cheques (million) written by customers of a bank each year is modelled by \(\text{cheques} = 52.4 - 4.6 \times t\), where \(t = 1\) is \(2018\). The model was fitted to data for \(2018\) to \(2024\). (i) Forecast the number of cheques in \(2026\). (ii) Forecast the number in \(2032\). (iii) Comment on each forecast.
Solution

Number the years from \(2018\), substitute, then compare each \(t\) with the data (\(t = 1\) to \(7\)).

\(2026\)\(:\)\(t = 2026 - 2018 + 1 = 9\)
\(\text{cheques}\)\(=\)\(52.4 - 4.6 \times 9\)
\(\text{cheques}\)\(=\)\(52.4 - 41.4\)
\(\text{cheques}\)\(=\)\(11\)
\(2032\)\(:\)\(t = 2032 - 2018 + 1 = 15\)
\(\text{cheques}\)\(=\)\(52.4 - 4.6 \times 15\)
\(\text{cheques}\)\(=\)\(52.4 - 69\)
\(\text{cheques}\)\(=\)\(-16.6\)

(i) \(11\) million. (ii) \(-16.6\) million. (iii) The \(2026\) forecast is only two years past the data, so it is reasonable if the trend continues. The \(2032\) forecast is impossible (a negative number of cheques): it is far beyond the data, and a linear decrease cannot continue forever.

Example 3 β€” Fit the trend line with technology
The yearly number of rooftop solar installations (hundreds) in Bendigo is shown, with \(t = 1\) for \(2019\).
Year201920202021202220232024
\(t\)123456
Installations (hundreds)242731323640
(i) Use technology to find the least squares trend line \(\text{installations} = a + bt\), with \(a\) and \(b\) correct to two decimal places. (ii) Interpret the slope. (iii) Forecast the number of installations in \(2026\).
Solution

Enter \(t\) as the explanatory variable and the installations as the response variable. The calculator does the following:

\(S_{tt}\)\(=\)\(17.5\)
\(S_{ty}\)\(=\)\(54\)
\(b\)\(=\)\(\dfrac{54}{17.5}\)
\(b\)\(\approx\)\(3.085714\)
\(a\)\(=\)\(\bar{y} - b\bar{t}\)
\(a\)\(\approx\)\(31.666667 - 3.085714 \times 3.5\)
\(a\)\(\approx\)\(20.8667\)
\(2026\)\(:\)\(t = 2026 - 2019 + 1 = 8\)
\(\text{installations}\)\(=\)\(20.87 + 3.09 \times 8\)
\(\text{installations}\)\(\approx\)\(45.6\)
Example 3: yearly solar installations with the least squares trend lineSix yearly values from 2019 to 2024 with a dashed trend line extended to 2026, where the ringed forecast is about 45.6 hundred 20 25 30 35 40 45 2019 2020 2021 2022 2023 2024 2025 2026 Installations (hundreds)

(i) \(\text{installations} = 20.87 + 3.09 \times t\). (ii) On average, installations increase by \(3.09\) hundred (about \(309\)) each year. (iii) About \(45.6\) hundred in \(2026\), two years past the data, with a strong linear pattern (\(r \approx 0.99\)).

Example 4 β€” Deseasonalise, fit, forecast, re-seasonalise
A Mildura houseboat company records its quarterly bookings. (Q1 = January to March, Q2 = April to June, Q3 = July to September, Q4 = October to December.)
YearQ1Q2Q3Q4
2024240189184253
2025300234216319
Seasonal index1.200.900.801.10
(i) Deseasonalise the bookings. (ii) Taking \(t = 1\) as Q1 \(2024\), use technology to fit a least squares trend line to the deseasonalised bookings (\(a\) and \(b\) to two decimal places). (iii) Forecast the actual bookings for Q1 \(2026\), correct to one decimal place.
Solution

Divide by the indices, fit the line to the deseasonalised values, forecast for the right \(t\), then multiply by the Q1 index.

\(\text{Q1}\)\(:\)\(\tfrac{240}{1.20} = 200,\ \ \tfrac{300}{1.20} = 250\)
\(\text{Q2}\)\(:\)\(\tfrac{189}{0.90} = 210,\ \ \tfrac{234}{0.90} = 260\)
\(\text{Q3}\)\(:\)\(\tfrac{184}{0.80} = 230,\ \ \tfrac{216}{0.80} = 270\)
\(\text{Q4}\)\(:\)\(\tfrac{253}{1.10} = 230,\ \ \tfrac{319}{1.10} = 290\)
\(S_{tt}\)\(=\)\(42\)
\(S_{ty}\)\(=\)\(520\)
\(b\)\(=\)\(\dfrac{520}{42} \approx 12.380952\)
\(a\)\(\approx\)\(242.5 - 12.380952 \times 4.5 \approx 186.7857\)
\(\text{Q1 2026}\)\(:\)\(t = 4 \times 2 + 1 = 9\)
\(\text{deseasonalised}\)\(=\)\(186.79 + 12.38 \times 9\)
\(\text{deseasonalised}\)\(=\)\(298.21\)
\(\text{forecast}\)\(=\)\(298.21 \times 1.20\)
\(\text{forecast}\)\(\approx\)\(357.9\)

(i) Deseasonalised: \(200,\ 210,\ 230,\ 230,\ 250,\ 260,\ 270,\ 290\). (ii) \(\text{deseasonalised bookings} = 186.79 + 12.38 \times t\). (iii) About \(357.9\) bookings in Q1 \(2026\). Q1 is a busy quarter (index \(1.20\)), so the forecast is above the trend value.

Common pitfalls

Get \(t\) right. Time periods are counted, not years: if \(t = 1\) is \(2019\), then \(2027\) is \(t = 9\), not \(t = 2027\) or \(t = 8\). For quarters, \(t = 4 \times (\text{years after the start}) + \text{quarter number}\).
Re-seasonalise seasonal forecasts. A trend line fitted to deseasonalised data gives a deseasonalised forecast. Multiply by the seasonal index to forecast the actual value for that season.
Do not trust long-range forecasts. Extrapolating far beyond the data assumes the linear trend never changes. The further ahead, the less reliable the answer, and it may even be impossible.

Frequently asked questions

What is the explanatory variable when fitting a trend line to a time series?

Time is the explanatory variable. The periods are numbered t = 1, 2, 3 and so on, and the data value is the response variable. The line is written y = a + bt.

How do I interpret the slope of a trend line?

The slope b is the average change in the data for each time period. For example, a slope of 12.5 with yearly data means the value increases by 12.5 each year on average. A negative slope means a decreasing trend.

How do I forecast with a trend line?

Work out the value of t for the future period, substitute it into y = a + bt and calculate y. If the line was fitted to deseasonalised data, multiply the result by the seasonal index for that season.

Why do I deseasonalise before fitting a trend line?

Seasonal ups and downs make the points zig-zag, which can pull the least squares line about. Deseasonalised values show the underlying trend, so the line models the long-term direction better.

What are the limitations of forecasting with a trend line?

The forecast assumes the trend stays linear and nothing changes. It is less reliable the further it goes beyond the data, and a long-range forecast can give impossible values, such as a negative number.

What does the intercept of a trend line mean?

It is the trend value at t = 0, the time period just before the first data value. It often has little practical meaning, but it fixes where the line starts.