The SDL Component Suite is an industry leading collection of components supporting scientific and engineering computing. Please visit the SDL Web site for more information.... 
Home MathPack Math2 Procedures and Functions MultiLinReg  
See also: SingValDecomp, SingValEquSolve, CalcLinFit, RidgeReg, SimPLS, RidgeRegStd, VarInflatFactor  
MultiLinReg 

The function MultiLinReg calculates the best approximated solution for an overdetermined equation system (more equations than variables). There are two overloaded versions available which provide different sets of parameters: Version [1]: The matrix InData contains the independent variables xi, the vector OutData contains the values of the dependent variable y. The function returns a TRUE value if the result is valid. In this case the coefficients a_{1} to a_{n} of the solution are contained in vector Coeff. Numerical instabilities which may arise from nearsingular equations are indicated by returning a TRUE value in the variable parameter NearSingular. In this case the calculated coefficients should not be used. The vector DeltaCoeff reflects the uncertainties of the estimated parameters in vector Coeff. In order to get the standard deviation of the parameters, DeltaCoeff has to be multiplied by the standard error of the residuals. The standard error can be calculated by
with n = number of rows of InData, k = number of columns of InData, and the Yi being the actual and the estimated OutData. The equation system to be solved can be denoted as follows (the coefficients ai correspond to the parameter Coeff, the values yi are stored in OutData, and the values xij are stored in InData ):
Please note that most often models involve a constant term, i.e.
In order to find a general least squares solution for such systems, you have to formally extend the equation to
with x_{0} = 1. This means that such models can be calculated by adding an extra column to the input data InData, filling this extra column by a constant value of 1.0. The vectors Coeff and DeltaCoeff have to be enlarged by 1 element accordingly (this is not true for version [2] because version [2] offers an option for forcing the model through the origin). Version [2]: The matrix Data contains all data, with some of the columns of Data being independent variables xi, and the column TargetVar being the dependent variable y. The indices of the independent variables are given by the open array VarList (valid range of indices: 1..Data.NrOfColumns). The model is forced through the origin if ForceOrigin is set to TRUE. The variable parameters StdDv, FStatistic and SminQ return the standard deviation of the residuals, the F value of the model and the sum of squared residuals, respectively. The variable parameters Coeff and DeltaCoeff contain the coefficients of the regression model and their uncertainties (see version [1] for details). If the variable parameter NearSingular returns TRUE the estimated coefficients should be used with caution due to numerical instability.
