Polynomial Regression
HOME Math Software Downloads Numerical Methods Register Your Software Contact Search Credit

Software:
Linear Algebra
Functions
Ordinary Differential Equations
Systems of Nonlinear Equations
Multiple Integration
Maxima and Minima
Functions and Equations
Regression
Approximation & Interpolation
Stereographer
Math Miscellanea
Support Software
Numerical Methods:
Integration and Differentiation
Solution of Equations
Maxima and Minima
Approximation of Functions
Regression
Polynomial Regression
Fast Fourier Transforms
Differential Equations
Linear Algebra Methods
Miscellaneous Procedures
Decimal Comma/Decimal Point
                            

   
Google
 
Polynomial Regression

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 n-dimensional 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 = a0+a1x+b0y+b1xy+c1y2+c1xy2 = (a0+a1x)+(b0+b1x)y+(c0+c1x)y2

where a0, a1, b0, b1, c0, c1 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      = a01     +a1x     +b0y    +b1xy    +c0y2  +c1xy2

xz     = a0x     +a1x2    +b0xy   +b1x2  +c0xy2 +c1x2y2

yz     = a0y     +a1xy    +b0y2   +b1xy2   +c0y3  +c1xy3

xyz    = a0xy    +a1x2  +b0xy2   +b1x2y2  +c0xy3 +c1x2y3

y2z    = a0y2    +a1xy2    +b0y3   +b1xy3   +c0y4  +c1xy4

xy2z   = a0xy2   +a1x2y2   +b0xy3  +b1x2y3  +c0xy4 +c1x2y4

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 5th degree in x and 6th 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:

    y:  -5     -2     2    3     6 
x
2      -720    -36   36   144   1260 
3      -2880   -144  144  576   5040 
4      -7200   -360  360  1440  12600
5      -14400  -720  720  2880  25200

The correlation coefficient is computed with

       [festimated - fmean]2
SQR ( )
           
[f-fmean]2

where the summations are over all data points.

The standard error of estimate is calculated using

       [f - festimated ]2
SQR ( )
               N-2

where the summations are also over all data points.

The festimated is found using the regression curve.

Copyright 2001-2010 Numerical Mathematics. All rights reserved.