Least squares y ≈ X β via QR. Dependent columns get coefficient 0 and are removed from (XᵀX)⁻¹; the remaining columns are refitted so the result is a proper least-squares solution.
Optional
Least squares y ≈ X β via QR. Dependent columns get coefficient 0 and are removed from (XᵀX)⁻¹; the remaining columns are refitted so the result is a proper least-squares solution.