Resources For Teachers For Tutors For Students & Parents AI New Books Pricing
Year 12 General (Unit 3 & 4) Time series analysis

Trend lines and forecasting

20 practice questions 0 video lessons Theory + worked examples

Use trend lines to look ahead in Year 12 General Mathematics for Queensland (QCAA). Councils planning school places in growing suburbs and tourism operators budgeting for next summer all need a sensible forecast, and a least-squares line through a time series gives one: \(y = mt + c\), where \(t\) counts the time periods.

You will practise numbering time periods, fitting the line on a scientific calculator, interpreting the slope as the average change per period, and making forecasts. For seasonal data you will fit the line to deseasonalised values, then multiply by the seasonal index, and judge how far ahead a forecast can be trusted.

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

Theory

A least-squares trend line \(y = mt + c\) models the long-term direction of a time series. This Year 12 General Mathematics guide for Queensland students shows how to fit it with a calculator, interpret the slope and \(y\)-intercept, and make forecasts, including seasonal forecasts from deseasonalised data.

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 trend line with \(t\) as the explanatory variable and the data as the response variable. Always state what \(t = 1\) stands for (for example, \(t = 1\) is Q1 \(2023\)).

The line is written \(y = mt + c\). Its slope \(m\) is the average change in the data per time period, and its \(y\)-intercept \(c\) is the value the line gives at \(t = 0\), the period just before the data start. Use your calculator's two-variable statistics mode to find \(m\) and \(c\).

A forecast is made by substituting a future value of \(t\). If the data are seasonal, fit the line to the deseasonalised values, forecast the deseasonalised value, and then multiply by the seasonal index to get the forecast for that season. Forecasting beyond the data is extrapolation: it assumes the trend continues, so it is most reliable only a short way ahead.

Key idea. Trend line \(y = mt + c\) with \(t\) the time period. Forecast \(= mt + c\) for yearly data, and \(\text{forecast} = (mt + c) \times \text{seasonal index}\) when the line was fitted to 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 45 55 65 75 85 2017 2019 2021 2023 2025 2027 Sales (thousand)
A least-squares trend line \(y = 3.71t + 44.79\) (\(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 60 65 70 75 80 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 2023 2024 2025 Deseasonalised value
For seasonal data, the trend line \(y = 1.73t + 60.11\) 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 = mt + c\]
y=mt+c

What the calculator works out (\(\bar{t}\) and \(\bar{y}\) are the means):

\[m = \dfrac{S_{ty}}{S_{tt}}, \qquad c = \bar{y} - m\,\bar{t}\]
m=StyStt,c=y¯−mt¯

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

\[\text{forecast} = (mt + c) \times \text{seasonal index}\]
forecast=(mt+c)×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 the calculator's two-variable statistics mode, \(t\) as the explanatory variable. Write \(y = mt + c\), with \(m\) and \(c\) usually to \(2\) decimal places.
  4. Interpret: the slope is the average change per period; the \(y\)-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. If the line forecasts a yearly total, divide by \(4\) (or \(12\)) first to get the average season, then multiply by the index.
  6. Judge reliability: a forecast is better when \(r\) is strong, the forecast is only a short way past the data, and nothing suggests the trend will change.
Example 1 β€” Interpret a trend line and forecast
The number of students enrolled at a Springfield primary school is modelled by the trend line \(y = 18.5t + 412\), where \(t = 1\) is \(2019\). (i) Interpret the slope. (ii) Interpret the \(y\)-intercept. (iii) Forecast the enrolment in \(2027\).
Solution

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

(i) Enrolments grow by about \(18.5\) students per year on average. (ii) At \(t = 0\) (\(2018\)) the trend value is \(412\) students.

\(t\)\(=\)\(2027 - 2019 + 1\)
\(t\)\(=\)\(9\)
\(y\)\(=\)\(18.5 \times 9 + 412\)
\(y\)\(=\)\(166.5 + 412\)
\(y\)\(=\)\(578.5\)

(iii) About \(579\) students in \(2027\).

Example 2 β€” Fit the trend line with technology
The yearly number of visitors (thousand) to a Rockhampton botanic garden is shown, with \(t = 1\) for \(2019\).
Year201920202021202220232024
\(t\)123456
Visitors (thousand)384145444952
(i) Use technology to find the least-squares trend line, with the slope and \(y\)-intercept correct to two decimal places. (ii) Find \(r\) and forecast the number of visitors in \(2026\). (iii) Comment on the reliability of the forecast.
Solution

Enter \(t\) as the explanatory variable and the visitors as the response variable.

\(S_{tt}\)\(=\)\(17.5\)
\(S_{ty}\)\(=\)\(46.5\)
\(m\)\(=\)\(\dfrac{46.5}{17.5}\)
\(m\)\(\approx\)\(2.657143\)
\(c\)\(=\)\(\bar{y} - m\bar{t} \approx 44.8333 - 2.657143 \times 3.5\)
\(c\)\(\approx\)\(35.5333\)
\(\text{trend line}\)\(:\)\(y = 2.66t + 35.53\)
\(r\)\(\approx\)\(0.97\)
\(2026\)\(:\)\(t = 8\)
\(y\)\(=\)\(2.66 \times 8 + 35.53\)
\(y\)\(\approx\)\(56.8\)
Example 2: yearly visitors 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 56.8 thousand 35 40 45 50 55 60 2019 2020 2021 2022 2023 2024 2025 2026 Visitors (thousand)

(i) \(y = 2.66t + 35.53\). (ii) \(r \approx 0.97\); forecast about \(56.8\) thousand visitors. (iii) The correlation is strong and \(2026\) is only two years past the data, so the forecast is fairly reliable, provided the trend continues.

Example 3 β€” Forecast a season from a deseasonalised trend line
The deseasonalised quarterly sales (\(\$\) thousand) of a Mackay outdoor-furniture store follow the trend line \(y = 3.4t + 120\), where \(t = 1\) is Q1 \(2023\). The seasonal index for Q2 is \(0.88\). (Q1 = January to March, Q2 = April to June, Q3 = July to September, Q4 = October to December.) Forecast the actual sales for Q2 \(2026\).
Solution

Find \(t\) for Q2 \(2026\), forecast the deseasonalised sales, then multiply by the Q2 index.

\(t\)\(=\)\(4 \times (2026 - 2023) + 2\)
\(t\)\(=\)\(14\)
\(\text{deseasonalised}\)\(=\)\(3.4 \times 14 + 120\)
\(\text{deseasonalised}\)\(=\)\(167.6\)
\(\text{forecast}\)\(=\)\(167.6 \times 0.88\)
\(\text{forecast}\)\(=\)\(147.488\)
\(\text{forecast}\)\(\approx\)\(147.5\)

Forecast actual sales for Q2 \(2026\): about \(\$147.5\) thousand. Q2 is a quieter quarter (index below \(1\)), so the forecast is below the trend value.

Example 4 β€” Deseasonalise, fit and forecast
A Bribie Island boat-hire business records its quarterly bookings. (Q1 = January to March, Q2 = April to June, Q3 = July to September, Q4 = October to December.)
YearQ1Q2Q3Q4
20241209988143
2025168126128187
Seasonal index1.200.900.801.10
(i) Deseasonalise the bookings. (ii) Taking \(t = 1\) as Q1 \(2024\), fit a least-squares trend line to the deseasonalised bookings. (iii) Forecast the actual bookings for Q1 \(2026\).
Solution

Divide by the indices, fit the line to the deseasonalised values, then multiply the forecast by the Q1 index.

\(\text{Q1}\)\(:\)\(\tfrac{120}{1.20} = 100,\ \ \tfrac{168}{1.20} = 140\)
\(\text{Q2}\)\(:\)\(\tfrac{99}{0.90} = 110,\ \ \tfrac{126}{0.90} = 140\)
\(\text{Q3}\)\(:\)\(\tfrac{88}{0.80} = 110,\ \ \tfrac{128}{0.80} = 160\)
\(\text{Q4}\)\(:\)\(\tfrac{143}{1.10} = 130,\ \ \tfrac{187}{1.10} = 170\)
\(S_{tt}\)\(=\)\(42\)
\(S_{ty}\)\(=\)\(420\)
\(m\)\(=\)\(\dfrac{420}{42} = 10\)
\(c\)\(=\)\(132.5 - 10 \times 4.5 = 87.5\)
\(\text{trend line}\)\(:\)\(y = 10t + 87.5\)
\(\text{Q1 2026}\)\(:\)\(t = 9\)
\(\text{deseasonalised}\)\(=\)\(10 \times 9 + 87.5\)
\(\text{deseasonalised}\)\(=\)\(177.5\)
\(\text{forecast}\)\(=\)\(177.5 \times 1.20\)
\(\text{forecast}\)\(\approx\)\(213\)

(ii) \(y = 10t + 87.5\). (iii) About \(213\) bookings in Q1 \(2026\), one quarter past the data, so it is a reasonable short-term forecast.

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}\).
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 trend never changes. The further ahead you forecast, the less reliable the answer.

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.

How do I interpret the slope of a trend line?

The slope is the average change in the data for each time period. For example, a slope of 18.5 with yearly data means the value increases by about 18.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 = mt + c, 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 fits the long-term direction better.

How reliable is a forecast from a trend line?

It is more reliable when the correlation is strong, when the forecast is only a short time past the data, and when there is no reason to expect the trend to change. Forecasting far into the future is risky extrapolation.

What does the y-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 sets where the line starts.