Learn

Learning preferences

Make learning more comfortable. Changes apply immediately.

Enlarges page content, including diagrams and their labels. You can also use your browser’s zoom.

Choose the colours that are easiest for you to distinguish. Applies to lesson diagrams and lab plots. Labels, shapes, hatching and line patterns also distinguish meanings. Source photographs and raw image brightness stay unchanged; mask-only views are available for image overlays.

ExampleComparisonSample link

Saved in this browser on this device. Preferences are separate from progress backups.

Lesson 3 of 3

Diagnose, freeze and evaluate a revision

Use residual and held-out evidence without turning fit agreement into a model-validation claim.

Loading your saved responses…

Try

The worked eight-row regression predicts minutes by 10+2x−z. Its residuals are −0.5, 0.5, −0.5, 0.5, −1.5, 1.5, −1.5, 1.5. The fit satisfies Xᵀr=0 exactly. Does that make equal noise variance plausible?

Group the residuals by x, rather than by their signs. These synthetic data were deliberately constructed to show a pattern; they are not evidence that a real population has this variance law.

Predictor xFour residualsSum of squared residualsMagnitude after internal standardization
−1−0.5, 0.5, −0.5, 0.511/√5 ≈ 0.4472
1−1.5, 1.5, −1.5, 1.593/√5 ≈ 1.3416

Explain why a residual average of zero in each group does not settle the spread question. Here each training leverage is 3/8 and s²=2, so the internal standardizing denominator is s√(1−h)=√(5/4). Standardization does not erase this pattern.

Predict

Predict what each finding would justify: a curved residual pattern, a larger spread at large x, or two future-looking responses inside a displayed prediction interval. None alone proves the complete model correct or incorrect. A pattern can motivate investigation; a probability statement needs a declared sampling and error model.

Before changing the fitted equation, write a proposed revision and a check that could reveal its failure. Keep separate three questions: does the calculation solve its least-squares problem, does the statistical model support its uncertainty claims, and do predictions work on the intended population?

Experiment

Return to the live regression workbench. With Worked regression data, set Residual plot horizontal axis to Predictor 1. Use the row table to verify the spread pattern. The plot supplies numerical axis labels; compare values rather than treating differently scaled displays as directly comparable pictures.

Choose Changed residual pattern, then select Predictor 1 again: loading data resets the horizontal axis to fitted response. The six-row fit is 5−x+2z and its residuals are 0.5, 0.5, −1, −1, 0.5, 0.5. At x=−1, 0, 1, they follow 1.5x²−1. On paper, add this correction to obtain 4−x+2z+1.5x². It fits these six training responses exactly. State why this is a development result, not a successful independent validation.

Now restore Worked regression data and the prediction row 0.5,−0.5. Record the equation, target row, mean prediction 11.5 and intended loss before selecting Freeze current regression model. The validation-response input appears after freezing. Enter 10.8,12.4: the frozen residuals are −0.7 and 0.9, with squared loss 0.49+0.81=1.30. These public synthetic values are already disclosed here; this activity rehearses a protocol and supplies no untouched evaluation evidence.

Change the training data after freezing. The workbench retains and labels the earlier frozen fit while showing the current fit separately. Changing the prediction row does not refit either model, but it changes the evaluation target: record that change rather than calling it the original frozen experiment. Reset regression experiment restores the initial data and clears the frozen snapshot. Temporary controls do not preserve an independent investigation record for you.

Understand

What the diagnostic calculation establishes

The normal equations force orthogonality to the included columns, not to every possible omitted function. For the six-row example, the residual vector is perpendicular to 1, x and z, but its relationship to x² remains visible. Adding x² uses information from the same responses. The four resulting columns have rank 4, so the residual dimension is 6−4=2 even though SSE is zero. Zero observed SSE does not establish zero population noise or justify a zero-width uncertainty interval.

Likewise, the eight-row spread pattern motivates a heteroskedastic model, meaning conditional error variance may depend on predictors. The usual covariance s²(XᵀX)⁻¹ and t intervals were derived under constant variance and independent Gaussian errors. They do not become justified simply because the software computes them. With repeated observations from the same person, the independent-row assumption can also fail. One must recover the design and choose an appropriate dependence model; replacing the displayed degrees of freedom by an invented number is not a repair.

A small residual or a high fit statistic cannot establish causal effects. Random assignment, sampling, timing and the possibility of omitted causes are properties of the investigation, not consequences of projection algebra. For these distinctions, revisit study designs when its context is relevant.

A nested comparison and its assumptions

For the worked data, omitting z gives SSE = 18; the full model gives SSE = 10. The reduced column space lies inside the full one. Under the null that the reduced mean model is correct, independent Gaussian errors of common variance, fixed full-rank designs, and a comparison specified without response-driven selection, the statistic is

F = [(18−10)/1] / [10/5] = 4.

Its reference distribution is F with 1 and 5 degrees of freedom, giving an upper-tail probability about 0.10194. This is not a probability that the omitted coefficient is zero. It also cannot certify the equal-variance assumption questioned by the residual plot.

To see the reference mechanism, let P₀ and P₁ be the reduced and full orthogonal projections, with ranks p₀ and p₁. Nestedness makes P₁−P₀ an orthogonal projection of rank d=p₁−p₀, perpendicular to I−P₁. Under the null, the improvement SSE₀−SSE₁ is εᵀ(P₁−P₀)ε. Orthogonal coordinates of a spherical Gaussian vector are independent, so its ratio to σ² is chi-square with d degrees of freedom, independent of SSE₁/σ², which is chi-square with n−p₁ degrees of freedom. Dividing each by its degrees of freedom yields the F law. This reuses the Gaussian projection theorem; equal variance or independence failures break this reference argument.

Freeze, evaluate, and revise honestly

A frozen fit fixes the fitted parameters and model specification. A meaningful evaluation record also identifies the target inputs, outcome collection, population, loss and any selection rules. New training edits can create a new candidate without changing the old model. Looking at evaluation outcomes and then selecting a revision exposes that evaluation set: its revised loss is useful development feedback, not a fresh independent check.

Two responses inside nominal 95% prediction intervals do not establish 95% coverage. Coverage is a repeated-sampling property under stated assumptions; two successes are little evidence about its frequency. Targets outside observed predictor ranges deserve attention, but being inside each separate range does not guarantee support for the joint predictor combination. The workbench’s range warning is a limited check, not a validated extrapolation detector.

Apply

The six-row linear model predicts 3 minutes at the new input x=2,z=0. The training-perfect quadratic revision predicts 8. Before looking at a new response, record which candidate you would use and what uncertainty remains. A separately supplied response is 3.2. Compute both squared losses, identify which model did better on this observation, and explain what you still cannot conclude.

Check the changed prediction and evidence boundary

The linear loss is (3.2−3)²=0.04; the quadratic loss is (3.2−8)²=23.04. The simpler candidate performs better on this one response despite having larger training loss. The new x lies outside the training range [−1,1], so this also tests extrapolation. One observation does not establish that the linear model is universally superior, and choosing it after seeing this response uses that response for selection. A subsequent independent check needs new evidence and a declared target. Preserve both predictions and the failed revision in the record instead of deleting the failure.

Continue

Use the course’s mixed written tasks to connect a fit certificate, a correctly targeted interval and a frozen evaluation decision. Return to coefficients and residuals or mean versus individual prediction for a targeted repair. These lessons provide bounded synthetic investigations and mathematical checks; a sustained investigation still needs justified data collection, independently retained evidence and human review.

Apply · explain · revise

Practice and reasoning

Drafts save locally as you type. Reveal worked solutions when useful; the site remembers that exposure. Automatic matches check the requested answer, while written arguments require review against the rubric.

The eight-row worked fit has residual magnitudes 1/2 at x=−1 and 3/2 at x=1, with identical leverage 3/8. Compute internally standardized magnitudes using s²=2. What does the pattern suggest, and what has not been proved?

Structure your argument and preserve revisions

These optional planning fields save locally. Recording your response saves an immutable copy of the argument and these fields. Older records may contain only first/latest responses; missing intermediate revisions are not reconstructed.

Each field allows 2,000 characters. Keep a specific claim, state where it applies, cite the facts you use, and explain what still needs checking. Blank fields are allowed and are not evidence of mastery.

For the six-row dataset in fitreg-changed-six-row-fit, residuals are 1/2 at x=±1 and −1 at x=0, for both z values. Propose and verify a quadratic mean revision. Does its zero training loss establish improvement on new observations?

Structure your argument and preserve revisions

These optional planning fields save locally. Recording your response saves an immutable copy of the argument and these fields. Older records may contain only first/latest responses; missing intermediate revisions are not reconstructed.

Each field allows 2,000 characters. Keep a specific claim, state where it applies, cite the facts you use, and explain what still needs checking. Blank fields are allowed and are not evidence of mastery.

A fitted model is frozen as m(x,z)=6+2x−z before revealing validation rows (x,z,y)=(0,1,5.4),(2,0,9.1),(−1,−1,5.2). Compute predictions, signed residuals y−m and total squared loss. A colleague shifts the intercept by the average validation residual before reporting loss. Audit the change.

Structure your argument and preserve revisions

These optional planning fields save locally. Recording your response saves an immutable copy of the argument and these fields. Older records may contain only first/latest responses; missing intermediate revisions are not reconstructed.

Each field allows 2,000 characters. Keep a specific claim, state where it applies, cite the facts you use, and explain what still needs checking. Blank fields are allowed and are not evidence of mastery.

On the worked eight rows, omitting z changes SSE from 10 to 18. With independent Gaussian homoscedastic errors, derive the extra-sum-of-squares F statistic and its degrees of freedom. Explain what a nonsignificant result would not establish, and what breaks if the residual spread warning is ignored.

Structure your argument and preserve revisions

These optional planning fields save locally. Recording your response saves an immutable copy of the argument and these fields. Older records may contain only first/latest responses; missing intermediate revisions are not reconstructed.

Each field allows 2,000 characters. Keep a specific claim, state where it applies, cite the facts you use, and explain what still needs checking. Blank fields are allowed and are not evidence of mastery.

Twenty people each generate four responses, recorded as 80 rows with an intercept and two predictors. A colleague treats the rows as independent, uses 77 residual df and the usual t intervals, and interprets an observational slope as causal. Separate the algebraic claims from the inferential and causal claims.

Structure your argument and preserve revisions

These optional planning fields save locally. Recording your response saves an immutable copy of the argument and these fields. Older records may contain only first/latest responses; missing intermediate revisions are not reconstructed.

Each field allows 2,000 characters. Keep a specific claim, state where it applies, cite the facts you use, and explain what still needs checking. Blank fields are allowed and are not evidence of mastery.

A fitted 95% prediction interval contains both of two new synthetic responses. Write a defensible evaluation statement and a revision protocol. Contrast this with the claim that two successes prove 95% future coverage.

Structure your argument and preserve revisions

These optional planning fields save locally. Recording your response saves an immutable copy of the argument and these fields. Older records may contain only first/latest responses; missing intermediate revisions are not reconstructed.

Each field allows 2,000 characters. Keep a specific claim, state where it applies, cite the facts you use, and explain what still needs checking. Blank fields are allowed and are not evidence of mastery.

Reflect and continue

Before marking this lesson complete, explain one key idea without the worked solution and identify a condition that matters. Marking complete records participation, not independent mastery.