Regression

  • | |

    Ordinary Least Squares

    Fitting a linear regression means solving one matrix equation, not one equation per observation. Stacking the data into a design matrix and minimizing the residual sum of squares gives the normal equation, whose closed-form solution fixes the coefficients uniquely whenever the cross-product matrix can be inverted. NumPy reproduces the computation.