Predictions, interpolation and extrapolation
Use the least squares line to make predictions in Year 12 VCE General Mathematics. If a Frankston car wash knows how sales rise with the temperature, it can plan staff for tomorrow's forecast. Substituting a value of the explanatory variable into the line gives the predicted response, but some predictions deserve far more trust than others.
You will practise substituting into \(y = a + bx\) and giving answers in context, then decide whether each prediction is interpolation (inside the data) or extrapolation (outside it). You will spot impossible results, explain why a strong \(r\) cannot rescue an extrapolation, and get ready to measure how much variation the line explains.
Theory
A least squares line turns data into predictions. This Year 12 General Mathematics guide for students in Victoria shows how to substitute into \(y = a + bx\), how to tell interpolation from extrapolation, and how to judge whether a prediction can be trusted.
A least squares line \(y = a + bx\) can be used to make a prediction: substitute a value of the explanatory variable \(x\) and calculate the predicted value of the response variable \(y\). In context, \(\text{response} = a + b \times \text{explanatory}\).
Interpolation is predicting for a value of \(x\) inside the range of the data, from the smallest \(x\)-value to the largest. Extrapolation is predicting for a value of \(x\) outside that range.
Extrapolation is risky: there is no data to show that the linear trend continues, and the line can give values that are impossible or unrealistic. A prediction is most reliable when it is an interpolation and the association is strong. The line only predicts the response; it is never rearranged to predict the explanatory variable.
A prediction from the least squares line, for a chosen value \(x_0\) of the explanatory variable:
Interpolation or extrapolation, where \(x_{\min}\) and \(x_{\max}\) are the smallest and largest \(x\)-values in the data:
Making and judging a prediction
- Write the line. Use \(y = a + bx\) with the variables in context, and check that the value you are given is a value of the explanatory variable.
- Substitute. Replace \(x\) with the given value and calculate \(y\), one step per line.
- Answer in context. Give the prediction with its units, rounded sensibly (for example a whole number of people or cars).
- Interpolation or extrapolation? Compare the \(x\)-value with the range of the data. Inside is interpolation; outside is extrapolation.
- Comment on reliability. An interpolation with a strong association is reliable. An extrapolation is not, especially if it gives an unrealistic value.
Substitute \(25\) for the temperature.
| \(\text{cars}\) | \(=\) | \(-24 + 4.8 \times 25\) |
| \(\text{cars}\) | \(=\) | \(-24 + 120\) |
| \(\text{cars}\) | \(=\) | \(96\) |
About \(96\) cars are predicted. Since \(25\) is between \(16\) and \(34\), this is interpolation.
Substitute each engine size, then compare it with the range \(1.4\) L to \(3.8\) L.
| \(\text{fuel use}\) | \(=\) | \(3.6 + 2.4 \times 2.5\) |
| \(\text{fuel use}\) | \(=\) | \(3.6 + 6\) |
| \(\text{fuel use}\) | \(=\) | \(9.6\) |
| \(\text{fuel use}\) | \(=\) | \(3.6 + 2.4 \times 5\) |
| \(\text{fuel use}\) | \(=\) | \(3.6 + 12\) |
| \(\text{fuel use}\) | \(=\) | \(15.6\) |
For \(2.5\) L: \(9.6\) L/100 km. This is interpolation with a strong association (\(r = 0.91\)), so it is reliable.
For \(5.0\) L: \(15.6\) L/100 km. This is extrapolation (\(5.0\) is above \(3.8\)), so it is not reliable: the trend may not continue for much larger engines.
| Maximum temperature, \(x\) (°C) | 22 | 25 | 27 | 29 | 31 | 34 | 36 |
|---|---|---|---|---|---|---|---|
| Visitors, \(y\) (hundreds) | 9 | 12 | 15 | 16 | 20 | 23 | 24 |
(b) Predict the number of visitors on a \(30\)°C day and on a \(42\)°C day, to the nearest hundred, and say which prediction is more reliable.
(a) Enter temperature as \(x\) and visitors as \(y\):
| \(S_{xx}\) | \(\approx\) | \(146.86\) |
| \(S_{xy}\) | \(=\) | \(165\) |
| \(b\) | \(=\) | \(\dfrac{S_{xy}}{S_{xx}}\) |
| \(b\) | \(=\) | \(\dfrac{165}{146.86}\) |
| \(b\) | \(\approx\) | \(1.123541\) |
| \(\bar{x}\) | \(\approx\) | \(29.14\) |
| \(\bar{y}\) | \(=\) | \(17\) |
| \(a\) | \(=\) | \(\bar{y} - b\bar{x}\) |
| \(a\) | \(\approx\) | \(17 - 1.123541 \times 29.142857\) |
| \(a\) | \(\approx\) | \(17 - 32.7432\) |
| \(a\) | \(\approx\) | \(-15.74\) |
| \(\text{visitors}\) | \(=\) | \(-15.74 + 1.12 \times 30\) |
| \(\text{visitors}\) | \(=\) | \(-15.74 + 33.6\) |
| \(\text{visitors}\) | \(=\) | \(17.86\) |
| \(\text{visitors}\) | \(=\) | \(-15.74 + 1.12 \times 42\) |
| \(\text{visitors}\) | \(=\) | \(-15.74 + 47.04\) |
| \(\text{visitors}\) | \(=\) | \(31.3\) |
(a) \(\text{visitors} = -15.74 + 1.12 \times \text{temperature}\).
(b) At \(30\)°C: about \(18\) hundred visitors (interpolation). At \(42\)°C: about \(31\) hundred visitors, but \(42\) is above the largest temperature in the data (\(36\)), so this is extrapolation. The \(30\)°C prediction is more reliable; on an extremely hot day people may stay away.
Substitute each age; then think about whether the answer is realistic.
| \(\text{time}\) | \(=\) | \(94 - 2.2 \times 13\) |
| \(\text{time}\) | \(=\) | \(94 - 28.6\) |
| \(\text{time}\) | \(=\) | \(65.4\) |
| \(\text{time}\) | \(=\) | \(94 - 2.2 \times 40\) |
| \(\text{time}\) | \(=\) | \(94 - 88\) |
| \(\text{time}\) | \(=\) | \(6\) |
At age \(13\): \(65.4\) seconds, an interpolation that looks sensible.
At age \(40\): \(6\) seconds. No one swims \(100\) m in \(6\) seconds, so this extrapolation is unrealistic: swimmers do not keep getting faster at the same rate as they age.
Common pitfalls
Frequently asked questions
How do you make a prediction from a least squares line?
Substitute the value of the explanatory variable into y = a + bx and calculate y. Give the answer in context with units.
What is the difference between interpolation and extrapolation?
Interpolation predicts for an x-value inside the range of the data. Extrapolation predicts for an x-value outside that range.
Why is extrapolation unreliable?
There is no data outside the range to show that the linear trend continues. The relationship may change, and the line can give impossible values such as a negative mass.
When is a prediction reliable?
When it is an interpolation, the association is strong and the residual plot shows no pattern.
Can I use the least squares line to predict x from y?
No. The line is fitted to predict the response from the explanatory variable. It should not be rearranged to predict the explanatory variable.