AP Precalculus · Topic 2.6 · Reading guide, about 5 min

Comparing models with residuals

Use residuals and residual plots to judge a model, spot the wrong model type, and choose between linear, quadratic and exponential.

In one minute

When you fit a function to data, how do you know the fit is any good? Looking at the graph helps, but a sharper tool is the residual: the gap between what actually happened and what your model predicted at each input.

Residuals show how large the errors are and, more importantly, whether they have a pattern. A curved pattern, such as a U or an arch, means the model type is wrong, even if the errors look small.

Key terms

Residual
Actual output minus predicted output at one input: residual=y−y^\text{residual}=y-\hat y.
Predicted value
The output the model gives for an input, often written y^\hat y. It is computed from the formula, not taken from the data.
Residual plot
A graph with inputs on the horizontal axis and residuals on the vertical axis, used to look for patterns in the errors.
Overestimate
The model predicts a value larger than the actual one, so the residual is negative.
Underestimate
The model predicts a value smaller than the actual one, so the residual is positive.
Random scatter
Residuals that bounce above and below zero with no clear shape. This suggests the model type suits the data.
Curved pattern
Residuals that form a U, an arch, or a wave. This signals that the model type is missing the shape of the data.
Regression
A method, usually on a calculator, that picks the model of a chosen type that best fits the data.

Computing and reading residuals

Residual means actual minus predicted, in that order. Suppose the data point is (5,40)(5,40) and the model predicts 46. The residual is 40−46=−640-46=-6. The negative sign means the model overestimated by 6 units.

A positive residual means the point sits above the graph of the model, and a negative one means the point is below it. For a line fit by regression, the residuals add up to exactly zero, so a few positives and a few negatives is normal.

A residual plot is just the list of residuals graphed against the input. For the point (5,40)(5,40) with residual −6-6, you would plot the point (5,−6)(5,-6). A plot that hugs the horizontal axis is good news, and a plot that makes a clear shape is a warning.

The size of the residuals matters in context. A residual of 6 is large if the outputs are around 20, but tiny if they are around 20,000. Judge the errors against the scale of the data.

Patterns that reveal a poor model

A good model leaves residuals with no pattern: they scatter above and below zero. A bad model leaves a shape. If a line is fit to data that curves upward (concave up), the points at the ends will be above the line and the points in the middle below, so the residual plot forms a U. The residuals are telling you the data bends, and a line cannot.

The reverse also works. If the residuals form an arch, the data is concave down, the other way. If the residuals fan out, growing in size as the input grows, the errors scale with the values. A fan alone does not prove the model type is wrong, so look at the signs too: if they also bend into a U or an arch, the model is missing a curve.

Small residuals alone do not prove that a model is right. A curved residual plot with small errors says the model is close but still the wrong type, and it will likely fail when you extrapolate.

What a residual plot suggests
Residual plotWhat it meansWhat to try
Random scatter near zeroModel type fits the dataKeep the model
U shape (for a line)Data is concave up, so the line misses the curveQuadratic or exponential
Arch shape (for a line)Data is concave downDownward quadratic or logarithmic
Spread grows with inputErrors get bigger as values get biggerCheck whether the signs also curve before changing models

Worked example and choosing a model

Data: inputs 1, 2, 3, 4 give outputs 3, 7, 13, 21. Try the line y^=6x−4\hat y=6x-4, which a calculator returns as the best-fit line. Predictions are 2, 8, 14, 20. Residuals, actual minus predicted, are 3−2=13-2=1, 7−8=−17-8=-1, 13−14=−113-14=-1 and 21−20=121-20=1. They are small, and they add to zero, but their signs go plus, minus, minus, plus, a U shape.

The pattern says to try a curve. The differences in outputs are 4, 6, 8, and the second differences are 2, 2, which are constant. By the finite difference idea from 1.3, that points to a quadratic. Indeed x2+x+1x^2+x+1 gives 3,7,13,213, 7, 13, 21 exactly, so every residual is 0.

To choose among linear, quadratic and exponential models, use several tools together. Check the table: constant differences suggest linear, constant second differences suggest quadratic, and constant ratios suggest exponential. Then check the residual plots, and finally use context. A population cannot be negative and an exponential decay never reaches zero, while a quadratic must eventually turn around, which may make no sense for the situation.

How it connects

  • Back to 1.3: second differences identify quadratics, which is one of the table tools used here.
  • Back to 2.5: regression produces the model, and residuals judge it.
  • Back to 2.2: constant ratios mean exponential, constant differences mean linear.
  • Forward to 2.14: logarithmic regression is judged with the same residual ideas.

Common mistakes

  • Subtracting in the wrong order. Residual is actual minus predicted. Reversing it flips every sign and every interpretation.
  • Trusting small residuals. Small errors with a clear curved pattern still mean the model type is wrong.
  • Expecting zero residuals. Real data has noise. Look for scatter with no shape, not perfection.
  • Ignoring context. A model can fit the data well and still predict impossible values, such as negative populations.

How it shows up on the exam

  • Given data and a model, compute residuals and say whether the model overestimates or underestimates.
  • Given a residual plot, state whether the model is appropriate and describe the evidence.
  • Compare two models for the same data and argue for one using residuals and the context.

Check yourself

  1. A model predicts 18 but the data value is 25. What is the residual, and does the model over- or underestimate?
  2. A residual plot shows an arch shape. What does that tell you about the model?
  3. Why can a model with small residuals still be a poor choice?
  4. What would you check besides residuals before choosing between a quadratic and an exponential model?

Practice this topic. AP Practice questions on exactly what this lesson covers, with an explanation for every answer.