Interpolation, extrapolation and predictions
Learn to make and judge predictions from a least-squares line, for Year 12 General Mathematics in Queensland (QCAA). Power companies, for instance, forecast electricity demand from the temperature, but a model built on mild summer days can mislead on a record heatwave. Knowing where the data stop is as important as the equation itself.
You will substitute into \(y = mx + c\) to predict values, decide whether each prediction is interpolation (inside the data) or extrapolation (outside it), and explain why extrapolation can give unrealistic or impossible answers. Next, you will see why even a strong association does not prove that one variable causes the other.
Theory
A least-squares line lets you predict one variable from another. This guide for Year 12 General Mathematics in Queensland shows how to make predictions, tell interpolation from extrapolation, and judge when a prediction can be trusted.
A least-squares line \(y = mx + c\) 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\).
Interpolation is predicting for an \(x\)-value inside the range of the data, from the smallest \(x\)-value to the largest. Extrapolation is predicting for an \(x\)-value 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.
To predict, substitute the value of the explanatory variable into the least-squares line:
Interpolation, where \(x_{\min}\) and \(x_{\max}\) are the smallest and largest \(x\)-values in the data:
Extrapolation:
Making and judging a prediction
- Substitute. Put the given \(x\)-value into \(y = mx + c\) and calculate \(y\). Include units.
- Classify. Find the smallest and largest \(x\)-values in the data. Inside the range is interpolation; outside is extrapolation.
- Check the strength. Use \(r\): strong (\(|r| \ge 0.75\)) supports a reliable prediction; moderate or weak does not.
- Judge. Say whether the prediction is reliable and why. For extrapolation, check whether the answer is even possible.
Substitute \(x = 26\), then compare it with the data range.
| \(y\) | \(=\) | \(4.5 \times 26 - 20\) |
| \(y\) | \(=\) | \(117 - 20\) |
| \(y\) | \(=\) | \(97\) |
| \(18 \le 26\) | \(\le\) | \(32\) |
About \(97\) cars. Since \(26\) °C lies inside the data range, this is interpolation.
Substitute each value, then check it against the range \(1.5\) to \(4.0\) L.
| \(y\) | \(=\) | \(2.2 \times 2.5 + 3.9\) |
| \(y\) | \(=\) | \(5.5 + 3.9\) |
| \(y\) | \(=\) | \(9.4\) |
| \(y\) | \(=\) | \(2.2 \times 5.0 + 3.9\) |
| \(y\) | \(=\) | \(11 + 3.9\) |
| \(y\) | \(=\) | \(14.9\) |
For \(2.5\) L: \(9.4\) L/100 km. This is interpolation and \(r = 0.93\) is strong, so it is reliable.
For \(5.0\) L: \(14.9\) L/100 km. This is extrapolation (above \(4.0\) L), so it is not reliable, even though \(r\) is strong.
| Max temp, \(x\) (°C) | 24 | 26 | 27 | 29 | 31 | 33 | 34 |
|---|---|---|---|---|---|---|---|
| Demand, \(y\) (MW) | 61 | 66 | 70 | 73 | 80 | 84 | 85 |
The calculator's regression mode gives \(m \approx 2.46\), \(c \approx 2.44\) and \(r \approx 0.99\). Substitute each temperature:
| \(y\) | \(=\) | \(2.46x + 2.44\) |
| \(y\) | \(=\) | \(2.46 \times 30 + 2.44\) |
| \(y\) | \(=\) | \(73.8 + 2.44\) |
| \(y\) | \(\approx\) | \(76\) |
| \(y\) | \(=\) | \(2.46 \times 40 + 2.44\) |
| \(y\) | \(=\) | \(98.4 + 2.44\) |
| \(y\) | \(\approx\) | \(101\) |
At \(30\) °C: about \(76\) MW. The data run from \(24\) °C to \(34\) °C, so this is interpolation, and \(r = 0.99\) is strong: reliable.
At \(40\) °C: about \(101\) MW. This is extrapolation, so it is less reliable. On very hot days, demand may rise faster than the line suggests.
Substitute each age, then compare it with the data (\(10\) to \(16\) years).
| \(y\) | \(=\) | \(-2.1 \times 13 + 92\) |
| \(y\) | \(=\) | \(-27.3 + 92\) |
| \(y\) | \(=\) | \(64.7\) |
| \(y\) | \(=\) | \(-2.1 \times 40 + 92\) |
| \(y\) | \(=\) | \(-84 + 92\) |
| \(y\) | \(=\) | \(8\) |
Age \(13\): \(64.7\) s, an interpolation, so it is sensible.
Age \(40\): \(8\) s, an extrapolation far beyond the data. A 100 m swim in \(8\) seconds is impossible: swimmers stop getting faster as they reach adulthood, so the linear trend does not continue.
Common pitfalls
Frequently asked questions
What is the difference between interpolation and extrapolation?
Interpolation predicts for an x-value inside the range of the data (from the smallest to the largest x-value). Extrapolation predicts for an x-value outside that range.
How do you make a prediction with the least-squares line?
Substitute the value of the explanatory variable for x in y = mx + c and calculate y. Give the answer with units and a sensible rounding.
Why is extrapolation dangerous?
There is no data outside the range to show that the linear trend continues. The relationship may change or stop, and the line can give values that are impossible or unrealistic.
When is a prediction reliable?
When it is an interpolation, the association is strong (r of 0.75 or more in size), and the residual plot shows a linear model is appropriate.
Is extrapolation always wrong?
Not always, but it is never supported by the data. A small step outside the range may be close; a large step is much more likely to be wrong.
Is a prediction at the smallest or largest x-value interpolation?
Yes. The endpoints are part of the data range, so a prediction exactly at the smallest or largest x-value counts as interpolation.