
Software: 
Download Polynomial Regression The method of LEAST SQUARES is used in the program to fit a multivariable polynomial to a tabulated function. The values of tabulated functions must be taken for values of the independent variables belonging to a rectangular grid which may be unevenly spaced, that is, a function of n variables must be tabulated at the nodes of an ndimensional rectangular grid. For example, if x and y are the independent variables, we may, for instance, have 6 values of x and 5 values of y and 30 values of the function, one for each (x,y) combination, and the grid may look like: To illustrate, suppose we have a tabulated function with 2 independent variables and with N data sets and we wish to fit to it a polynomial of first degree in x and second degree in y. The polynomial to be fitted is then z = a_{0}+a_{1}x+b_{0}y+b_{1}xy+c_{1}y^{2}+c_{1}xy^{2} = (a_{0}+a_{1}x)+(b_{0}+b_{1}x)y+(c_{0}+c_{1}x)y^{2} where a_{0}, a_{1}, b_{0}, b_{1}, c_{0}, c_{1} are the coefficients to be determined. To minimize the residuals by the least squares method we have to solve the following set of normal equations: åz = a_{0}å1 +a_{1}åx +b_{0}åy +b_{1}åxy +c_{0}åy^{2} +c_{1}åxy^{2} åxz = a_{0}åx +a_{1}åx^{2} +b_{0}åxy +b_{1}åx^{2}y +c_{0}åxy^{2}^{ }+c_{1}åx^{2}y^{2} åyz = a_{0}åy +a_{1}åxy +b_{0}åy^{2} +b_{1}åxy^{2} +c_{0}åy^{3} +c_{1}åxy^{3} åxyz = a_{0}åxy +a_{1}åx^{2}y +b_{0}åxy^{2 } +b_{1}åx^{2}y^{2} +c_{0}åxy^{3 }+c_{1}åx^{2}y^{3} åy^{2}z = a_{0}åy^{2} +a_{1}åxy^{2} +b_{0}åy^{3} +b_{1}åxy^{3} +c_{0}åy^{4} +c_{1}åxy^{4} åxy^{2}z = a_{0}åxy^{2} +a_{1}åx^{2}y^{2}^{ } +b_{0}åxy^{3} +b_{1}åx^{2}y^{3} +c_{0}åxy^{4} +c_{1}åx^{2}y^{4} where the summations are over all N data sets, that is, from 1 to N. The system may be solved as it stands,
especially since we have only 6 equations.
However, had we wanted, for instance, a polynomial of 5^{th}
degree in x and 6^{th} degree in
y, we would already be dealing with 42
equations. Furthermore, if you have 10 values for
x and 10 values for
y , you would have 100 data sets
over which to perform the above summations.
But the program takes advantage of the fact that the
grid is rectangular to shorten the computations. An example of a tabulated function with one evenly spaced variable and one
unevenly spaced is: The correlation coefficient is computed with
å
[f_{estimated}  f_{mean}]^{2
}SQR (
—————————————————————— ) where the summations are over all data points. The standard error of estimate is calculated using
å
[f  f_{estimated} ]^{2
}SQR (
————————————————————— ) where the summations are also over all data points. The f_{estimated} is found using the regression curve. 

Copyright © 20012010 Numerical Mathematics. All rights reserved.
