Two variables in a data set that demonstrate a slightly changing rate of change can be modeled by linear, quadratic, and exponential functions. Real data is never perfect, so you look for the pattern that is nearlythere. A calculator's regression then builds the model for each type.
| Look for | Suggests | Model |
|---|---|---|
| nearly constant first differences | linear | y = mx + b |
| nearly constant second differences | quadratic | y = ax² + bx + c |
| nearly constant ratios | exponential | y = a·bx |
Example. The values 3.1, 4.4, 7.2, 10.4, 15.2, 20.4, 27.1 have first differences 1.3, 2.8, 3.2, 4.8, 5.2, 6.7. They keep growing, so linear is not a good fit. The second differences 1.5, 0.4, 1.6, 0.4, 1.5 stay small and show no steady trend, which points to a quadratic model.
Real data has a rate of change that changes slightly. Pick a data set and a model type. The tool fits the model like a calculator's regression, and the table shows the first differences, second differences, and ratios that hint at which model fits.
| x | 0 | 1 | 2 | 3 | 4 | 5 | 6 |
|---|---|---|---|---|---|---|---|
| y | 4.2 | 6.9 | 10.3 | 12.8 | 16.1 | 19.2 | 21.8 |
| 1st differences | — | 2.7 | 3.4 | 2.5 | 3.3 | 3.1 | 2.6 |
| 2nd differences | — | — | 0.7 | -0.9 | 0.8 | -0.2 | -0.5 |
| ratios | — | 1.64 | 1.49 | 1.24 | 1.26 | 1.19 | 1.14 |
Models can be compared based on contextual clues and applicability to determine which is the most appropriate. Two models can both pass through the data. Only one may make sense for the situation.
| Context clue | Best model |
|---|---|
| the same amount is added each step | linear |
| rises then falls, or falls then rises (a turning point) | quadratic |
| each step multiplies by about the same factor | exponential |
Example. A ball is thrown upward and its heights are recorded. A linear model cannot go up and then come down, and an exponential model cannot turn around either. The quadratic h(t) = −16t² + 40t + 5 matches the situation. But a quadratic is only valid while the ball is in the air: at t = 4 it predicts a height of −91 feet, which is below the ground.
Several models can fit the same data. The context decides which one makes sense. Pick a situation, read the clues, and compare what each model predicts far beyond the data.
To validate a model, measure how far each data point is from it. A residual is the actual value minus the predicted value:
A residual plot graphs the residuals on the vertical axis against the independent variable on the horizontal axis. A model is justified as appropriate when the residual plot appears without pattern: the points scatter above and below 0, with no curve or long one-sided stretch.
Example. The line y = 3x + 4 predicts 4, 7, 10, 13, 16 for x = 0 to 4. The actual values are 4.3, 6.8, 10.4, 12.9, 16.2, so the residuals are +0.3, −0.2, +0.4, −0.1, +0.2. They bounce above and below 0, so the line is justified.
A residual is the actual value minus the predicted value. The residual plot puts the residuals on the vertical axis and the input on the horizontal axis. A model is justified as appropriate when the residual plot appears without pattern.
| x | 0 | 1 | 2 | 3 | 4 | 5 | 6 |
|---|---|---|---|---|---|---|---|
| actual | 3.1 | 4.4 | 7.2 | 10.4 | 15.2 | 20.4 | 27.1 |
| predicted | 0.54 | 4.54 | 8.54 | 12.54 | 16.54 | 20.54 | 24.54 |
| residual | +2.56 | -0.14 | -1.34 | -2.14 | -1.34 | -0.14 | +2.56 |
The error in a model at an input can be reported two ways: as a signed difference(the residual) or as an unsigned absolute value of the residual.
| Residual | Meaning |
|---|---|
| positive (actual > predicted) | the model underestimates |
| negative (actual < predicted) | the model overestimates |
| zero | the model matches the data point exactly |
Errors can show that a model underestimates or overestimates on a given interval. The data set and context may tell you which kind of error is preferred. A baker ordering flour would rather overestimate. A company promising a minimum delivery would rather underestimate.
Example. A line fitted to Data set 2 from the tool above has residuals +2.56, −0.14, −1.34, −2.14, −1.34, −0.14, +2.56. The line underestimates at the ends and overestimates in the middle, which is another sign that a line is the wrong type.
The error at an input can be the signed difference (the residual) or its unsigned absolute value. A positive residual means the model underestimates. A negative residual means it overestimates. The context can tell you which kind of error you prefer.
| x | 0 | 1 | 2 | 3 | 4 | 5 | 6 |
|---|---|---|---|---|---|---|---|
| signed error | +0.05 | -0.14 | +0.16 | -0.13 | +0.16 | -0.14 | +0.05 |
| unsigned error | 0.05 | 0.14 | 0.16 | 0.13 | 0.16 | 0.14 | 0.05 |
| the model | under | over | under | over | under | over | under |