Lab · c08.s04.L1
Least-squares drag
The fit is where the residual stops leaning on either column of the design matrix; two gauges read zero together only at the best line.
Question: Where does the least-squares formula come from?
Frame 1 of 11: The line you are givenThe stored default: the candidate line is tilted +0.2 and shifted +0.4 away from the best fit. Both needles sit off zero: the residual sum reads −5.4 and the residual weighted by x reads −17.0, so the residual still leans on both columns of the design matrix. The squared error is 6.979048, above the best-fit 1.419048.
The line you are given. The stored default: the candidate line is tilted +0.2 and shifted +0.4 away from the best fit. Both needles sit off zero: the residual sum reads −5.4 and the residual weighted by x reads −17.0, so the residual still leans on both columns of the design matrix. The squared error is 6.979048, above the best-fit 1.419048.
Keyboard: Space plays or pauses, Left and Right step, Home goes to the first frame, End goes to the last frame.
Text description of this lab
Six numbered points scatter around a solid russet candidate line, with a short vertical residual stick from each point to the line. Two gauges show the residual sum and the residual weighted by x. Both needles read zero only when the candidate line lies on the dashed navy best fit. Tilting the line, shifting it, or moving one point pushes the needles away and raises the printed squared error, which is smallest at the fit.
Return to the section that hosts this lab
Caption status: synthetic. Every lab declares one of published, re-simulated, schematic, synthetic or interpolated.