Interactive library

Geometry of Least Squares

Data space

The same fit as a line

Drag points vertically

least-squares line vertical residuals candidate line

Observation space

Projection in ℝ3

rank(X) = 2 · plane

data y projection ŷ residual r other fit Xβ
Accessible numerical view Observation table Expand values
Observation xi yi ŷi ri