Unit 2 · Topic 2.6

Competing Function Model Validation

Residuals (actual minus predicted) measure how far a model misses each data point.

Practice 3: Communication and Reasoning

Part 1 · Hook

Why this matters

Two analysts model a channel's followers. One fits a line, the other an exponential function, and both graphs look close to the data. The residuals, the misses each model makes, decide which one to trust for next month.

Part 2 · Before you start

What this builds on

Part 3 · Prerequisite check

Quick check before you start

1. Over equal steps, outputs go 100,125,156.25100, 125, 156.25. What fits?

  1. Exponential, ratio 1.251.25
  2. Linear, slope 2525
  3. Linear, slope 1.251.25
  4. Quadratic
Show the answer

125100\frac{125}{100}=156.25125= \frac{156.25}{125}=1.25= 1.25: constant ratio.

  • Correct: Exponential, ratio 1.251.25:
  • Linear, slope 2525:
  • Linear, slope 1.251.25:
  • Quadratic:

2. What does a calculator regression do?

  1. Finds the constants of a chosen model type that fit all the data closest
  2. Finds a model through exactly two points
  3. Chooses the model type for you
  4. Rounds the data
Show the answer

You choose the type; the regression chooses the constants.

  • Correct: Finds the constants of a chosen model type that fit all the data closest:
  • Finds a model through exactly two points:
  • Chooses the model type for you:
  • Rounds the data:

Part 4 · See it

See it first

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.
Residuals (actual minus predicted) of two models of the same data. The linear model's residuals form a U; the exponential model's scatter near 0 with no pattern, so it is the more appropriate model. LevlPrep original diagram.

Part 5 · Step by step

How it works, step by step

  1. For each data point, subtract the prediction from the actual valuethe residuals: positive where the model underestimates, negative where it overestimates
  2. Plot the residuals against the inputa residual plot
  3. Small residuals with no patternthe model is appropriate; a curve or trend means it misses the shape of the data

Part 6 · Key ideas

Key ideas

  • Residual == actual −- predicted. Positive: the model underestimates. Negative: it overestimates.
  • An appropriate model has a residual plot scattered around 0 with no pattern; a U or a trend shows the model has the wrong shape.
  • Error can also be stated as predicted −- actual, or as an absolute error |predicted−actual||\text{predicted} - \text{actual}|. Compare competing models by their residuals.

Part 7 · Misconception

A common mistake

The wrong idea: If a model's residuals are both positive and negative, the model fits well.

What actually happens: Mixed signs are expected; what matters is the pattern. Residuals that go positive, negative, positive in order show a curve the model misses.

Part 8 · Check yourself

Check yourself

Exam-style questions. Anything you miss goes into your review queue.

Graph

Residual plots for two models of follower counts

A new video channel had 210,262,330,410,515,640210, 262, 330, 410, 515, 640 and 805805 followers at the end of weeks t=0t = 0 to 66. A linear regression LL and an exponential regression EE were fit to the data. The plot shows each model's residuals, actual minus predicted: open circles for LL, filled dots for EE.
123456−60−40−2020406080t (weeks)residual (followers)

1. Based on the residual plots, which model is more appropriate for the data, and why?

  1. LL, because its residuals are both positive and negative
  2. EE, because its residuals are small and show no pattern
  3. LL, because its residuals form a smooth curve
  4. EE, because its residuals are mostly above 00
Show the answer

An appropriate model leaves residuals scattered around 00 with no pattern. The residuals of LL form a U: positive, then negative, then positive, which means the data bend away from the line. The residuals of EE stay near 00 with no pattern.

  • LL, because its residuals are both positive and negative: Mixed signs are fine only without a pattern; these form a U.
  • Correct: EE, because its residuals are small and show no pattern: Small, patternless residuals.
  • LL, because its residuals form a smooth curve: A curved pattern in the residuals is the sign of a poor model.
  • EE, because its residuals are mostly above 00: The residuals of EE are positive and negative.

2. The residual of LL at t=0t = 0 is positive. What does that mean?

  1. LL predicts more followers than the channel really had at t=0t = 0
  2. The channel gained followers at t=0t = 0
  3. LL predicts fewer followers than the channel had at t=0t = 0
  4. LL is increasing at t=0t = 0
Show the answer

Residual == actual −- predicted. A positive residual means actual >> predicted: the model underestimates there.

  • LL predicts more followers than the channel really had at t=0t = 0: That is a negative residual, an overestimate.
  • The channel gained followers at t=0t = 0: A residual compares the model to the data; it is not a change in followers.
  • Correct: LL predicts fewer followers than the channel had at t=0t = 0: Actual minus predicted is positive: an underestimate.
  • LL is increasing at t=0t = 0: The sign of a residual says nothing about whether the model is increasing.

Table

Two models of a growing plant

Height of a plant, in centimeters, at week t, with the predictions of a linear model A and an exponential model B
tt (weeks)0123
Actual height (cm)50627897
Model AA (cm)48637893
Model BB (cm)5062.578.197.7

3. What is the residual of model AA at t=3t = 3?

No calculator. Type the exact value (a fraction, π, e or a root is fine), in cm.

Show the answer

Residual == actual −- predicted =97−93=4= 97 - 93 = 4 cm. Model AA underestimates at t=3t = 3.

  • Answer: 4 cm

4. Which model fits the data in the table better, and why?

  1. BB, because its residuals are all closer to 00
  2. AA, because it matches the data exactly at t=2t = 2
  3. AA, because its residuals are whole numbers
  4. BB, because its predictions are larger
Show the answer

The residuals of AA are 2,−1,0,42, -1, 0, 4; those of BB are 0,−0.5,−0.1,−0.70, -0.5, -0.1, -0.7. Every residual of BB is at least as close to 00, and the largest error of BB (0.70.7 cm) is smaller than the largest of AA (44 cm).

  • Correct: BB, because its residuals are all closer to 00: Smaller errors at each time.
  • AA, because it matches the data exactly at t=2t = 2: One exact match does not outweigh larger errors elsewhere.
  • AA, because its residuals are whole numbers: Whole numbers are not a measure of fit.
  • BB, because its predictions are larger: Larger predictions are better only where the model underestimates.

5. How is a residual defined in this course?

  1. Predicted value minus actual value
  2. Actual value divided by predicted value
  3. Actual value minus predicted value
  4. The difference between two predictions
Show the answer

A residual is actual minus predicted. The error of a prediction can be stated as predicted minus actual, or as the absolute value of the difference.

  • Predicted value minus actual value: This is the opposite sign; it is the error of the prediction, not the residual.
  • Actual value divided by predicted value: A residual is a difference, not a ratio.
  • Correct: Actual value minus predicted value: Positive when the model underestimates.
  • The difference between two predictions: A residual compares a prediction with data.

6. A model predicts 142142 visitors, and 150150 visitors come. What is the absolute error of the prediction?

No calculator. Type the exact value (a fraction, π, e or a root is fine), in visitors.

Show the answer

The absolute error is |predicted−actual||\text{predicted} - \text{actual}|=|142−150|= |142 - 150|=8= 8 visitors.

  • Answer: 8 visitors

Part 9 · Summary

Summary

Residuals (actual minus predicted) measure how far a model misses each data point. Choose the model whose residuals are small and patternless, and read the sign of the residuals to say where a model underestimates or overestimates.

Part 10 · Up next

What comes next

Part 11 · Connections

Connections