What Can the Errors Left by a Model Teach Us? Keep the observed values beside the model’s predictions, calculate the signed residuals, then investigate the structure that remains. An attractive fit statistic is not the end of the analysis. Learners need to explain what the model misses, compare alternatives using stated criteria and distinguish fitting the old data from predicting a new observation.
This international lab uses an original fictional calibration exercise with exact numbers. It builds on the Correlation and Pairing Lab but asks a different question: how well does a proposed prediction rule account for the recorded responses? AI can generate rival rules and help check calculations. The coursework and rubric are proposals, not validated educational interventions; future superintelligence remains hypothetical.
- Specify observed response, predicted response and the sign convention for residuals.
- Distinguish mean signed error, mean absolute error and squared error.
- Derive and inspect a least-squares line on a small dataset.
- Recognise patterns that a single fit score can hide.
- Compare training fit with a separate test case and state the limits.
- Use AI to propose alternatives without surrendering the ability to audit them.
Choose your reading route
Coursework series: Correlation and Pairing Lab · Interpolation and Extrapolation Lab · Linear Systems and Identifiability Lab · Measurement Resolution Lab · Vocabulary Coding and Engineering
Continue this coursework series: Residual and Model Fit Lab (this article) · Logarithmic Scale Lab · Data Join and Cardinality Lab · Contrast and Concession Studio
Full chapter index
Chapters 1–5
Chapters 6–10
Chapters 11–15
Chapters 16–20
Chapters 21–25
Chapter 26
1. The capability: inspect what remains
A model compresses a collection of observations into a rule. A prediction table makes that compression visible: each row has an input, an observed output and a calculated output. The difference may reveal information that the rule has not captured. Ask learners to retain these rows instead of replacing them with a single claim that the model is accurate.
The coursework deliverables are a prediction register, residual calculation, comparison of candidate rules and a separate test. Learners should be able to reconstruct the reasoning without needing the original AI conversation. The objective is not to reject every imperfect model, but to understand when an imperfection matters for the stated purpose.
2. Define a residual before computing one
For a response y at input x, let the model prediction be ŷ. This lab uses residual e = y − ŷ. A positive residual means the observed response is above the prediction; a negative residual means it is below. NIST’s model-validation guidance uses this observed-minus-fitted convention and describes why analysing residuals is important.
Keep the residual in the response’s units. If a response is measured in millimetres, a residual of −2 means the model predicted two millimetres more than was observed. It is not a negative distance. For a new test observation, we will use the same subtraction but call it a prediction error to distinguish it from an in-sample residual.
3. Vocabulary Coding and Engineering for model diagnosis
In eduKate’s proposed Vocabulary Coding and Engineering framework, separate fit, prediction, residual, bias in this particular sample, and model adequacy. Fit describes agreement with the data being examined; a prediction may refer to an input not used to estimate the rule. A mean signed residual summarises direction, not the typical magnitude of individual misses.
Keep a vocabulary ledger with a counterexample beside each definition. For instance, residuals −2 and +2 average to zero but neither is zero. Do not let the phrase zero average error drift into perfect fit. VCE is a proposed way to organise meanings and checks, not evidence of an automatic improvement in learning.
4. The original five-point calibration exercise
Revisit the five curved-register pairs introduced in the Correlation and Pairing Lab, now as a fictional calibration exercise using exact unitless classroom values. The inputs are −2, −1, 0, 1 and 2. Their responses are 4, 1, 0, 1 and 4. Start with model A, ŷ = 2, and model B, ŷ = x². The teacher supplies these numbers as a constructed dataset rather than measurements from a physical instrument.
Before evaluating either model, specify the question: which rule agrees better with these five values, under squared residual loss? A separate question asks whether the rule can predict future values. Treat the two questions separately. A model can win the first comparison without being the best rule for an unobserved setting.
5. Build the residual register for the constant rule
For model A, every prediction is two. The observed-minus-predicted residuals, in increasing input order, are 2, −1, −2, −1 and 2. Their sum is zero. The corresponding absolute residuals are 2, 1, 2, 1 and 2, and their squared values are 4, 1, 4, 1 and 4.
Ask a peer to verify the signs at x = −2 and x = 0. The first observation lies two units above the prediction; the middle observation lies two units below it. A reversed sign convention would retain the squared losses but reverse the interpretation. Preserve the column labels so a subsequent reader can check the meaning of each number.
6. Calculate three error summaries
The mean signed residual is 0/5 = 0. Mean absolute error is 8/5 = 1.6. Sum of squared residuals is 14; mean squared error is 14/5 = 2.8. Root mean squared error is √2.8, approximately 1.673. The table preserves the data and both predictions before summarising them.
These measures answer different questions. Squaring gives large errors greater weight than small ones; absolute values avoid cancellation without squaring. Root mean squared error restores the response’s units when units are present. State which score is used for comparison and why, instead of switching after seeing which favours a preferred model.
| x | Observed y | A prediction | A residual | B prediction |
|---|---|---|---|---|
| -2 | 4 | 2 | 2 | 4 |
| -1 | 1 | 2 | -1 | 1 |
| 0 | 0 | 2 | -2 | 0 |
| 1 | 1 | 2 | -1 | 1 |
| 2 | 4 | 2 | 2 | 4 |
7. Derive the least-squares straight line
Now allow a straight line ŷ = a + bx. The mean x is zero and mean y is two. For these five points, the sum of xy is −8 − 1 + 0 + 1 + 8 = 0, while the sum of x² is ten. For any fixed b, the best intercept under squared loss is two, since mean x is zero.
With that intercept, expanding the sum of squared residuals gives 14 + 10b² because the cross-term sum x(y − 2) is zero. The minimum occurs at b = 0, yielding model A, ŷ = 2. The best straight line in this chosen family therefore still leaves a clear curved pattern. Minimisation within a family does not establish that the family is adequate.
8. Inspect residuals in input order
Plot or list (x,e) for model A: (−2,2), (−1,−1), (0,−2), (1,−1), (2,2). The middle observations fall below the rule while the two extremes lie above it. This is a structured pattern, not evidence that every prediction is merely fluctuating around the observed value without direction.
NIST’s residual-plot guidance discusses looking for structure in residuals against predictors. Here the five observations were deliberately constructed, so do not carry out a significance test or assert that their shape establishes a statistical population pattern. The exercise illustrates a concrete diagnostic question: could a different rule account for the missed curvature?
9. Compare a quadratic candidate
For model B, substitute each x into ŷ = x². The resulting predictions are exactly 4, 1, 0, 1 and 4. Every residual is zero, and the squared-loss sum is zero. On the five supplied points, the quadratic agrees exactly, whereas the best straight line has residual sum of squares fourteen.
State the limited conclusion: B wins this in-sample squared-error comparison. Do not infer from the score alone that the true mechanism in a physical device would be quadratic. The rule is also not evidence of a causal relationship. The case is useful because learners can separate exact agreement on supplied data from claims that require further evidence.
10. A zero mean residual is not a zero error
A generated report says that model A is perfect because its mean signed residual is zero. The counterexample is already in the record: at x = 0, the residual is −2; at x = 2, it is +2. The signed sum cancels, but absolute and squared errors remain positive.
Repair the report to say that the mean signed residual vanishes for these observations while individual residuals range from −2 to +2 and exhibit a systematic shape. An accurate summary retains the measure, its scope and the result’s limitation. Merely replacing zero with another number would not repair the misuse of the term perfect.
11. Compare a model with a deliberately shifted intercept
Consider model C, ŷ = 3, without fitting it. Its residuals are 1, −2, −3, −2 and 1. Their sum is −5, so mean signed residual is −1. Absolute errors sum to nine; squared errors sum to nineteen. Model C overpredicts by one unit on average in this constructed dataset.
Compare C with A on the same rows. Adding one to all predictions has increased squared loss by five because A’s residuals summed to zero. This controlled change illustrates why an intercept adjustment may repair overall offset without removing the curved pattern. Learners should inspect both the aggregate measure and the individual errors.
12. A flexible rule can fit the same five points
Construct model D, ŷ = x² + x(x−1)(x+1)(x−2)(x+2). Each product term vanishes at the five training inputs, so D and B give the same predictions there. Both have zero training residuals, despite being distinct functions.
At x = 3 the product is 3 × 2 × 4 × 1 × 5 = 120, so D predicts 129, while B predicts 9. Exact training fit does not identify the function uniquely when the allowed model family is unrestricted. Simpler rules can be preferable for a stated reason, but simplicity alone does not prove truth.
13. Separate a fresh test from choosing the model
In a fictional second stage, the teacher reveals a withheld test pair (3,10). B predicts 9 and has test error +1; D predicts 129 and has test error −119. A predicts 2 and has test error +8. Report these separately from the five training residuals.
The result favours B on this one test case. It does not establish performance on all future inputs or all systems. If the class repeatedly modifies models in response to this test point, it becomes part of the development process; another genuinely independent check is needed for an honest new test. The distinction matters more than the name of the dataset.
14. Compare large errors under different loss functions
Two separate fictional candidate error lists are P: [0,0,0,4] and Q: [2,2,2,2]. P has mean absolute error one and mean squared error four. Q has mean absolute error two and mean squared error four. The absolute-error comparison favours P while squared loss ties.
Neither list implies a universal choice. If no individual miss may exceed three units, P violates that constraint and Q does not. Name any such threshold before choosing the rule, and distinguish a hard acceptance condition from an average measure. This makes a model comparison accountable to the task rather than to whichever metric looks most flattering.
15. Record error scale and changing units
Suppose a response and its predictions are both expressed on a scale ten times larger. Each residual is multiplied by ten. Mean absolute error and root mean squared error also multiply by ten, while mean squared error multiplies by one hundred. The relative ordering of candidate scores remains unchanged under that common positive scale change.
However, a score of 2.8 in one scale cannot be compared directly with 2.8 in another. State units or the classroom convention beside the result. When comparing unlike outputs, agree on any normalization and justify it. A generated chart without units can make a correct calculation misleading.
16. Consider what the exercise has left out
The register contains exact invented values and no model of measurement noise. It cannot tell us how to estimate uncertainty, whether errors are independent, or what sample would represent a wider population. Those questions become important when moving from a classroom example to observed data.
Do not invent observations to make a model appear more reliable. If an actual record is missing, distinguish missing information from a zero response. A small dataset can expose logical mistakes, but it cannot establish a universal accuracy claim. Keep the original observations and their collection conditions available for inspection.
17. Use AI to investigate a pattern, not hide it
Give AI the five pairs and a candidate rule. Request every prediction, signed residual, absolute error and squared error. Ask for one alternative whose training fit is identical but whose prediction at a new input differs. The learner should test the returned rule at each original input and one fresh input.
Avoid a request such as make the fit look better. Instead state the allowable family, error measure and test boundary. Record what the generated proposal changes and what remains unchanged. This converts the AI response into a hypothesis that can be investigated rather than a persuasive but uncheckable verdict.
18. A prompt with a frozen evaluation rule
Try: Use the five pairs from the lab and residual = observed − predicted. Compare constant and quadratic rules using sum of squared residuals. Show the complete residual list; explain any structure. Do not change the observations or claim that training fit proves predictive validity. Keep the supplied test point separate until all candidate rules are defined.
After obtaining the output, calculate the constant rule independently and verify at least two quadratic substitutions. Request an error analysis of the claim that mean signed residual zero means perfect fit. Include the correction in the learner’s submitted record. A good AI prompt exposes what must remain stable throughout an analysis.
19. A proposed assessment rubric
Use four dimensions, each scored zero to three: accurate prediction register; correct residual and loss calculations; diagnosis of structured errors and their limits; and independently justified test comparison. Zero indicates absent relevant evidence; one a partial attempt with a substantial error; two mostly sound work with an identified gap; three correct and reproducible reasoning.
Record dimensions separately, even when the total is reported out of twelve. Give feedback on the exact missing check rather than judging intelligence from a single score. The rubric is an original classroom proposal, not a validated proficiency scale. Preserve accessibility aids and allow a verbal explanation or table when a graph is a barrier.
20. Independent transfer: compare rules on a new register
A fresh fictional register has x values 0, 1, 2, 3 and y values 1, 3, 7, 13. Compare rule E, ŷ = 1 + 4x, with rule F, ŷ = x² + x + 1. Before reading the worked check, calculate each prediction, residual and squared loss independently. Then state which rule has lower training loss.
Check: E predicts 1,5,9,13; residuals are 0,−2,−2,0, so squared loss is eight. F predicts 1,3,7,13; squared loss is zero. A held-out pair (4,20) gives E prediction 17 and error +3; F prediction 21 and error −1. F wins these comparisons, but the four training points and one test cannot establish a universal rule.
21. Primary learning: compare guesses with counters
Use three picture cards displaying quantities 2, 4 and 6. A fictional guessing rule predicts four on every card. Children can place counters representing the difference and describe whether a guess was too high or too low. Two errors cancel in a signed total, but each still represents a mismatch.
Ask the child to compare a second rule that matches the cards and explain the evidence rather than introducing squared losses prematurely. Use tactile objects, spoken descriptions or large print. Adults can prepare checked practice cards with AI; direct access to an AI service is unnecessary for this activity.
22. Secondary learning: compare model families
Students can derive the constant and straight-line rules for the five-point register, produce an accessible residual plot or coordinate table, and compare the quadratic alternative. Require a separate test after candidates are fixed. Make the chosen loss and units visible in each submission.
Extend the activity by changing one supplied response and recalculating how the models compare, while retaining the original record. Students should explain whether the altered register represents a new hypothetical example or a correction of an actual mistake. Avoid teaching that removing a difficult observation is inherently a good modelling technique.
23. University, institutions and EnDist
Advanced work can investigate regression assumptions, regularization, cross-validation and prediction uncertainty using suitable data and methods. Residual plots may guide model refinement, but they are not automatic diagnoses of a particular cause. Repeatedly selecting a model on the same evaluation data can limit what that evaluation establishes.
Within eduKate’s proposed EnDist framework, AI could distribute the capacity to fit models across more people. Education should also distribute the ability to check those models and explain when their predictions fail. A shared evaluation protocol, preserved records and independent tests let different participants challenge a result on the same basis.
24. A four-week Residual and Model Fit Lab
Week one constructs the five-point register, calculates the constant rule’s errors and checks the vocabulary ledger. Week two derives the best straight line, compares the quadratic and inspects the residual pattern. Deliver an explicit comparison under the same loss and input scope.
Week three examines the identical-training-fit counterexample, withheld case and alternate loss functions. Week four completes the independent transfer, explains a rejected AI claim and improves a chosen rubric dimension. Adjust the schedule to learners’ needs; the sequence is an instructional proposal rather than a prescribed curriculum.
25. Questions about fit, errors and evidence
Can a model have zero mean signed residual but make mistakes? Yes, as model A shows. Does zero squared training loss prove that a rule will predict future data? No, as the two distinct zero-loss rules illustrate. Do residuals prove why a model failed? They can reveal structure worth investigating, but additional evidence is necessary to determine a cause.
Should all models be judged by the same error measure? A fair comparison for a specific question uses consistent criteria, while different tasks may require different criteria. Is AI allowed to help? It may propose models and calculations, but the learner should preserve observations, verify errors and defend the evaluation rule.
26. Sources, boundaries and next steps
The statistical background is supported by NIST’s model-validation guidance and NIST’s residual-plot guidance. The original fictional registers, alternative rules, transfer exercise and rubric were designed for this article. They do not report empirical educational outcomes or establish the accuracy of any real predictive system.
The next step is to prepare a small, fully specified dataset and two candidate rules. Explain one error that an average conceals, reserve a separate test and record the reason for accepting or rejecting each candidate. That is a transferable capability: the ability to examine the remaining error rather than mistaking a finished model for finished reasoning.
Related coursework: Correlation and Pairing Lab · Interpolation and Extrapolation Lab · Linear Systems and Identifiability Lab · Measurement Resolution Lab.