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 2 of 3

Choose the uncertainty target

Derive conditional mean and new-response intervals, including rank and zero-spread boundaries.

Loading your saved responses…

Try

The worked regression predicts 11.5 minutes at x=1/2,z=−1/2. Are you estimating the average response at those predictor values, or a single new unit’s response? The point prediction is the same, but the second question includes a new unit’s own variation. Fitting the average more precisely cannot remove that variation.

Keep the eight-row model from fitting coefficients: β̂=(10,2,−1), SSE=10, residual degrees of freedom 5 and s²=2. The new design row is u=(1,1/2,−1/2), including the intercept. Its coefficient-uncertainty factor is

h₀ = uᵀ(XᵀX)⁻¹u = (1+1/4+1/4)/8 = 3/16.

This is not the variance itself: estimated mean variance is s²h₀=3/8. A new independent response has estimated prediction-error variance s²(1+h₀)=19/8.

Predict

Predict which interval is wider and whether either should contain 95% of the training residuals. Neither interval is defined that way. The first targets a conditional population mean; the second targets one new response under the same stipulated model. Both depend on assumptions about the mean equation and errors.

For a two-sided 95% interval and 5 residual degrees of freedom, the critical t value is approximately 2.57058184. Before reading the table, multiply it by √(3/8) and √(19/8). The covariance matrix, critical value and standard error have different jobs.

Target at (x,z)=(1/2,−1/2)Estimated varianceStandard error95% reference interval, minutes
Conditional mean3/8√(3/8)[9.925847,13.074153]
New independent response19/8√(19/8)[7.538467,15.461533]

These are rounded, model-conditional calculations. The engineered residual pattern in the next lesson makes checking equal variance especially relevant; numerical evaluation is not confirmation of that assumption.

Experiment

Return to the regression workbench. Reset to the worked data and set Prediction row: predictor values only to 0.5,−0.5. Compare both intervals with the table. The tool supplies the leading intercept 1; do not type it as an extra predictor.

Change the prediction row to 0,0, then to 2,0, without changing training data. Predict the mean and uncertainty factors first. For these rows h₀ is respectively 1/8 and 5/8, so the corresponding estimated mean variances are 1/4 and 5/4. Predictions are 10 and 14. The second input exceeds the observed range of x. A displayed extrapolation warning identifies that particular issue; being inside every separate coordinate range would not guarantee support near a joint predictor combination or a valid mean model.

This exercise changes the target while preserving the fitted model. Editing the training rows is a different operation. For validation, the next lesson explicitly freezes the model before revealing new outcomes.

Understand

State the hypotheses before deriving a t interval

Let X be a fixed n-by-p full-column-rank real design, n>p. Assume y=Xβ+ε with ε∼N(0,σ²I), σ²>0: the mean equation is correct, errors are independent Gaussian with the same variance. Treat a target row u as fixed, not selected after inspecting an unusually favorable result. Here p counts the intercept as well as the other coefficients.

Write H=X(XᵀX)⁻¹Xᵀ, the orthogonal projection onto the design column space. The multivariate normal projection theorem gives:

  • β̂−β is centered Gaussian with covariance σ²(XᵀX)⁻¹.
  • SSE/σ²=‖(I−H)ε‖²/σ² has a chi-square distribution with n−p degrees of freedom.
  • The fitted Gaussian projection and the residual projection are independent. In particular, β̂ and SSE are independent.

The chi-square assertion uses an orthonormal basis of the residual space: its n−p coordinates are independent N(0,σ²). Orthogonality alone would not imply independence for arbitrary non-Gaussian errors. We reuse that established theorem rather than asserting a t law from a plot.

Derive the two pivots

The mean estimation error uᵀ(β̂−β) is normal with variance σ²h₀, where h₀=uᵀ(XᵀX)⁻¹u. For a nonzero target u this is positive. Dividing by s√h₀, where s²=SSE/(n−p), gives a t variable with n−p degrees of freedom. Thus the mean interval is

uᵀβ̂ ± t* s√h₀.

A future observation is y₀=uᵀβ+ε₀, where ε₀ is independent of all training errors and has the same N(0,σ²) distribution. Its prediction error is ε₀−uᵀ(β̂−β). Independence adds the variances to σ²(1+h₀), and this normal error remains independent of training SSE. Its t pivot gives

uᵀβ̂ ± t* s√(1+h₀).

The added 1 represents new observation noise, not a larger number of coefficients. For repeated use at a fixed target under the assumptions, these interval procedures have their nominal coverage. The resulting fixed interval is not a probability distribution for β, nor a universal envelope over all predictor rows. Searching many rows or interpreting many intervals simultaneously is a different coverage question.

Leverage and standardized residuals

For a training row, hᵢ=Hᵢᵢ is its leverage. Since H is a symmetric orthogonal projection, hᵢ=‖Heᵢ‖² lies between 0 and 1, and Σhᵢ=tr(H)=p. For our orthogonal worked design, each hᵢ=(1+xᵢ²+zᵢ²)/8=3/8; their sum is 3.

Cov(r)=σ²(I−H), so Var(rᵢ)=σ²(1−hᵢ) and Cov(rᵢ,rⱼ)=−σ²Hᵢⱼ for distinct indices. Raw residuals need not be independent even when the original errors are. Dividing by s√(1−hᵢ) creates an internally standardized residual, a useful diagnostic scale. Because s is estimated from the same residual vector, these values are not an independent standard-normal sample or automatically ordinary t statistics. A large magnitude is a reason to investigate, not an automatic deletion instruction.

A new-row factor h₀ is also useful for uncertainty, but it is not restricted to [0,1] like a training diagonal of H. Far-away targets can have large h₀. Neither large nor small h₀ measures all model error.

When the regular calculation is unavailable

If the design is deficient, the ordinary coefficient inverse is unavailable; identify the model before applying these formulas. If n=p, there is no residual degree of freedom for estimating noise this way. If SSE=0, s=0 makes the ordinary t pivot undefined; an exact engineered fit does not establish a zero-noise population. If a training leverage is 1, its internally standardized residual has zero denominator. Dependence, unequal variances or an incorrect mean equation undermine the exact reference even when the software can print numbers. Alternative methods require their own hypotheses and are not silently substituted here.

Apply

A full-rank fit has n=10,p=2,SSE=32. At a proposed target its fitted response is 7 and h₀=1/4. Set up 90% intervals for the conditional mean and a new independent response under the stated Gaussian model. Then explain which part of uncertainty would persist even with extremely precise coefficient estimates.

Check the two standard errors

Residual degrees of freedom are 8 and s²=32/8=4. The mean standard error is 2√(1/4)=1; the prediction standard error is 2√(5/4)=√5. With c=t(0.95,8), the intervals are 7±c and 7±c√5. The second remains wider because the future unit has its own noise. More training information can reduce coefficient uncertainty without removing conditional response variability. These statements still depend on the correct mean and noise model.

Continue

In diagnostics and frozen validation, inspect why the residual plot raises a question about equal variance, then retain a frozen prediction before opening separate responses. The regression diagnostics foundation explains why fitted identities alone cannot validate the error model.

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.

Use the six-row fit in fitreg-changed-six-row-fit, or recompute it: β̂=(5,−1,2), (XᵀX)⁻¹=diag(1/6,1/4,1/6), SSE=3 and n=6. Under independent Gaussian equal-variance errors, construct 95% intervals for the mean and a new independent response at row u=(1,1/2,−1/2). Show the target difference.

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.

Under y=Xβ+ε with fixed full-rank X and ε∼N(0,σ²I), σ²>0 and n>p, derive exact t pivots for a fixed mean target uᵀβ and a new independent observation there. State the Gaussian projection facts used.

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 report must answer (a) average duration for units at a specified predictor row and (b) the duration of one future independent unit at that same row. The fitted mean is 12, s²=9, h0=1/4 and residual df 10. Set up 90% intervals for both without substituting a normal critical value. Which uncertainty remains even when a large training sample drives h0 toward zero?

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.

Prove H=X(XᵀX)⁻¹Xᵀ has leverages hi between 0 and 1 and sum p. Under independent equal-variance errors derive Var(ri). Explain why dividing ri by s√(1−hi) produces a diagnostic rather than independent exact standard-normal test statistics.

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.

Use X rows (1,0),(1,0),(1,1), y=(1,3,7). Find fit, residuals, SSE, df and all leverages. Which internally standardized residual is undefined? Does its zero raw residual certify that its observation is accurate?

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 full-rank fit with n>p has SSE=0 on engineered data. Someone prints zero-width 95% intervals and claims exact certainty everywhere, including a predictor far beyond the observed region. Explain what the zero fit establishes and why the inference claim fails.

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.