Least-Squares Geometry Explorer
Fit real-world data with a line or curve, then inspect the residuals that least squares is trying to shrink.
Residual Variance Minimization 🖖
Least squares regression geometrically projects high-dimensional raw data points onto a lower-dimensional linear subspace. By explicitly minimizing the squared residual orthogonal distances, we statistically determine the mathematically optimal fit line, actively suppressing random stochastic noise and extracting true systemic correlation.
Why we square the gaps 🖖
The tool adds up the squares of the vertical gaps between each point and the line, then hunts for the line that makes that total as small as possible. Squaring means a gap twice as wide counts four times as much, so the fit works hard to avoid any single large miss. Drag one point far off and watch the whole line lunge toward it — that pull is the direct price of squaring.
Regression is not symmetric 🖖
Because least squares only shrinks the vertical gaps, it quietly assumes y is the target and x is exact. Swap the axes and refit, and you get a different line — not the mirror image you would expect. Both lines pass through the data's average point (x̄, ȳ), but they coincide only when the points sit perfectly on a line. The two slopes even multiply out to r², the squared correlation.
Example problems
- course retention - Clean linear points with small residuals and low SSE.
- campaign outlier - Single outlier dominates SSE and tilts best-fit line.
- braking with line - Quadratic-shaped data under linear model shows structured residual pattern.
- braking with curve - Quadratic model captures curvature and lowers SSE.
- housing prices - Real-world housing price versus size linear relation.