# Multiple Polinomial Regression

1. Jun 17, 2011

### acmilanhn

Hi friends,
I need to get the surface equation like function f(x,y) that passes through 66 points.
I attached the file xls where is the points, and a pdf file where is the graphics of the points.

Can somebody help say me that I have to do for solve it?

#### Attached Files:

File size:
172.2 KB
Views:
73
• ###### Puntos x, y, z.xls
File size:
23 KB
Views:
72
2. Jun 17, 2011

### TheoMcCloskey

acmilanhn,

Does the approximation need to truely go through each of the data points (that is, approximate exactly at the data points) or is a more general approximation acceptable (one where the predicted values approximates the data at the data points)?

The former would generally involve an interpolation approximation while the latter could be treated more simply by, say, Least Squares.

3. Jun 17, 2011

### acmilanhn

I think my friend that using least squares can work, with r2=0.999999. But the same time, I need to graph the surface therefore I have to get the equation of the surface...

4. Jun 18, 2011

### TheoMcCloskey

You can perform a multilinear regression (least squares) using a design matrix consisting of two dimensional monomials.

For example, a third degree (bi-cubic) approximation can be generated if you consider as basis functions the following:

$$[1,x,x^2,x^3, y,yx,yx^2, y^2, y^2x, y^3]$$

Construct a design matrix with columns computed with your data using this basis. Then regress. You'll obtain the various coefficents for each term. Examine the degree of fit.

Your prediction formula would then be:

$$\hat{z}(x,y) = g_0(x) + y \, \left(g_1(x) + y \, \left(g_2(x) + g_3(x) \, y \right) \right)$$
with
$$g_0(x)= c_0+x \, (c_1 + x \, (c_2 + c_3 \, x ))$$
$$g_1(x)= c_4+x \, (c_5 + c_6 \, x)$$
$$g_2(x)= c_7+c_8 \, x$$
$$g_3(x)= c_9$$

A higher degree of fit requires a higher order polynomial. But this can have disadvantages as the number of terms can easily grow large. Also, you have to be concerned about the number of data and order of fit as well as the possibilities of numerical ill-condition.

However, this approach is not difficult. In fact, it can easily be done in Excel. For example, see the enclosed Excel file where I took your file and performed this analysis.

#### Attached Files:

• ###### Puntos x, y, z (TMcC).xls
File size:
87 KB
Views:
71
5. Jun 18, 2011

### acmilanhn

excelent my friend.... how to use Excel for solve it?

6. Jun 19, 2011

### TheoMcCloskey

acmilanhn,

There are a couple ways to perform this. You can use the Regression tool from the Analysis Toolpak (which is what I did) or you could just as easily use the LINEST Excel (array) function. The Regression tool will give you a static solution while the LINEST function will give you a dynamic solution (one that changes when inputs change).

Either one will do the job. Look them up in Excel help.