Unit 2 Topic 2.6

Competing Function Model Validation

see every function move

3 min readfreeNot practiced

Two models of the same data can both look close on a graph. One might be a line and the other an exponential function, and the eye cannot always tell which is better. The tool for deciding is the residual: how far the model misses each data point. This page defines residuals, reads residual plots, and uses them to choose between competing models, a skill the calculator section of the exam and Question 2 both test.

Residuals

For each data point,

residual=actual value−predicted value\text{residual} = \text{actual value} - \text{predicted value}

  • A positive residual means the actual value is above the prediction: the model underestimates there.
  • A negative residual means the actual value is below the prediction: the model overestimates there.
  • A residual of 00 means the model hits the data point.

The size of a miss can also be stated as the error, predicted minus actual, or as the absolute error |predicted−actual||\text{predicted} - \text{actual}|. Keep the order straight: a question that asks for the residual expects actual minus predicted.

Worked example 1. A plant is 50,62,78,9750, 62, 78, 97 cm tall at weeks 00 to 33. Model AA predicts 48,63,78,9348, 63, 78, 93 and model BB predicts 50,62.5,78.1,97.750, 62.5, 78.1, 97.7. Compare them.

Residuals of AA: 50−48=250 - 48 = 2, 62−63=−162 - 63 = -1, 78−78=078 - 78 = 0, 97−93=497 - 93 = 4.

Residuals of BB: 00, 62−62.5=−0.562 - 62.5 = -0.5, 78−78.1=−0.178 - 78.1 = -0.1, 97−97.7=−0.797 - 97.7 = -0.7.

Every residual of BB is closer to 00, and its largest miss is 0.70.7 cm against 44 cm for AA. Model BB fits better. Its residuals are slightly negative, so it slightly overestimates.

Residual plots

A residual plot graphs each residual against its input. It magnifies the misses so you can see their pattern.

What the residual plot showsWhat it means
Small residuals scattered above and below 00, no patternThe model has the right shape: appropriate
A U shape (positive, negative, positive)The data bend upward away from the model: try a concave-up model
An upside-down U (negative, positive, negative)The data bend downward: try a concave-down model
Residuals that grow steadily in sizeThe model misses more and more as the input grows
Residual plot for seven weekly follower counts: the linear model's residuals (squares) form a U, positive at both ends and negative in the middle; the exponential model's residuals (circles) stay near 0 with no pattern.
Figure 1. Residuals of a linear and an exponential model of the same follower counts. LevlPrep original diagram.

Worked example 2. A channel had 210,262,330,410,515,640,805210, 262, 330, 410, 515, 640, 805 followers at weeks 00 to 66. Use regression and residuals to choose between a linear and an exponential model.

Linear regression gives L(t)L(t)=97.357...t+161.071...= 97.357...t + 161.071.... Its residuals are about 49,4,−26,−43,−36,−8,6049, 4, -26, -43, -36, -8, 60: a U.

Exponential regression gives E(t)E(t)=210.016...(1.2506...)t= 210.016...(1.2506...)^t. Its residuals stay within about 33 followers of 00 with no pattern (see the figure).

Conclusion with reasons: "EE is more appropriate, because its residuals are small and show no pattern, while the residuals of LL form a U, so the data curve upward away from the line." Then predict with the stored EE: E(8)=1256.991...E(8) = 1256.991... followers.

Most graphing calculators can draw a residual plot straight from a regression. Store the regression first, then plot the residual list against the input list.

Mixed signs are not enough

A common wrong answer is "the linear model fits, because some residuals are positive and some are negative." Almost any model's residuals have both signs. What matters is whether they fall in a pattern. Residuals of one sign across an interval also say something: if every residual on 3≤t≤63 \le t \le 6 is positive, the model underestimates on that whole interval.

Error beyond the data

Residuals exist only where there is data. Past the last data point, a model's error is unknown and usually grows: a small error in the base of an exponential model is multiplied again with every unit of input. Choose the model with the best residuals, and still say that predictions far beyond the data are less reliable.

Spot a mistake on this page?