Computing Residuals for a Fitted Line
A residual records the difference between an observation and the model's prediction under a specified sign convention.
- Source
- Anbloq
- Language
- English
- Created
- Updated
- Chapters
- 4
- Reading time
- 1 min
In this article4 chapters
Trace two predictions
For \(\hat y=1+2x\), x=2 gives five. If observed y is six, the observed-minus-predicted residual is one. At x=3 with observed six, the residual is minus one. Linear prediction supplies the fitted values.
Use residuals beyond a total
Their sum is zero here, while both predictions differ from observations. Absolute and squared losses retain magnitudes.[1]
Calculate signed residuals from one clear convention
A fitted line predicts \(2+x\). For inputs one, two and four with observed targets two, five and six, its predictions are three, four and six. Residuals defined as observed minus predicted are minus one, one and zero. See systematic residual patterns.
x 1 2 4
Actual 2 5 6
Fitted 3 4 6
Residual -1 1 0
Keep cancellation out of error magnitude summaries
The signed residuals sum to zero here despite two inaccurate predictions. Mean absolute and squared error remain positive. Report the sign convention before interpreting bias.