kipedia.org/wiki/Ordinary_least_squares Algorithm: vector_of_coefficients = Inv(XT*X)*XT*Y X - Matrix of input variables. XT - X transposed. Inv() - calculate the inverse matrix. Y - vector of output variables. Note: the input matrix X must have full column rank, i.e. the columns of this matrix must be linearly independent! Note: To calculate the standard error for each coefficient a matrix already used to calculate the coefficients is needed. Therefore this implementation stores a possibly huge matrix after getCoefficients() until getStandardErrorForEachCoefficient() is called.
@author Rene Schulz
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.