Thread: Homework#6 Q2
View Single Post
Old 05-15-2012, 07:15 PM
sakumar sakumar is offline
Join Date: Apr 2012
Posts: 40
Default Re: Homework#6 Q2

Originally Posted by View Post
hi everyone,
Can anyone please explain me how to transform the data using the nonlinear transformation is given by
phi(x1, x2) = (1, x1, x2, x21, x22 , x1x2, |x1 − x2|, |x1 + x2|)

I am just confused how to use that in my code. I mean for the new values which function to use for transformation?

is it x1=x1^2 and x2=x^2 and so on or something else. I am sure i am missing a big concept here. Any help would be great.

Thanks in advance.
There is a typo in the way you have written the vector above. The 4th term is x1^2, the fifth term is x2^2.

But basically you have the right idea. You are given a data vector with two values. Create a larger data vector of 8 terms, seven of which are dependent on the original two values you are given.

In the new vector the first three terms are 1, x1, x2. The remaining 5 terms are obtained by applying "transformations" to x1 and x2. For example, the sixth term is x1*x2.

Then you do linear regression on the new x matrix you have built which is (for the given an 8x35 matrix. 35 data vectors, each with 8 terms as above.
Reply With Quote