Normal equations
The equations from which the least squares coefficients follow: XᵀX b = Xᵀy. Their solution b = (XᵀX)⁻¹Xᵀy minimises the sum of squared residuals.
Example: Three points (1, 2), (2, 4), (3, 6): 3b₀ + 6b₁ = 12 and 6b₀ + 14b₁ = 28. The solution is b₀ = 0, b₁ = 2.
Caution: The solution exists only if XᵀX is invertible, that is with no perfect collinearity. Programs solve it numerically and not by inverting.