ordinary least squares regressor Algorithm

In statistics, ordinary least squares (OLS) is a type of linear least squares method for estimate the unknown parameters in a linear regression model. OLS chooses the parameters of a linear function of a set of explanatory variables by the principle of least squares: minimizing the sum of the squares of the differences between the observed dependent variable (values of the variable being detected) in the given dataset and those predicted by the linear function.

ordinary least squares regressor source code, pseudocode and analysis