Re: [R] non-linear regression for 3D data

2010-08-15 Thread szisziszilvi
Thanks a lot, this I(xx^2) ... worked. I guess, I should learn more abot the function poly itself. (so will I... :) ) Thanks again! -- View this message in context: http://r.789695.n4.nabble.com/non-linear-regression-for-3D-data-tp2320982p2325911.html Sent from the R help mailing list archive

Re: [R] non-linear regression for 3D data

2010-08-12 Thread szisziszilvi
I've tried lm, but something is wrong. I've made a test dataset of 599 data points, my original equation is zz = 1 +0.5*xx -3.2*xx*xx -1*yy +4.2*yy*yy but the R gives this result: --- mp - read.csv(file=sample.csv,sep=;,header=TRUE) lm(zz ~

Re: [R] non-linear regression for 3D data

2010-08-12 Thread szisziszilvi
right. How does it come that if I devide the result vector with 10*interception, I get a much better result? zz2 - 25.86 -2239.86*mp$xx -595.01*mp$xx*mp$xx + 2875.54*mp$yy + 776.84*mp$yy*mp$yy mp$zz2 - zz2 library(lattice) cloud(zz2/258.6 + zz ~ xx * yy, data=mp) looks quite pretty.

Re: [R] non-linear regression for 3D data

2010-08-12 Thread Duncan Murdoch
On 12/08/2010 10:35 AM, szisziszilvi wrote: I've tried lm, but something is wrong. I've made a test dataset of 599 data points, my original equation is zz = 1 +0.5*xx -3.2*xx*xx -1*yy +4.2*yy*yy but the R gives this result: --- mp -

[R] non-linear regression for 3D data

2010-08-11 Thread szisziszilvi
Hello! Is there a simplier way in R to get a nonlinear regression (like nls) for a surface? I have 3D data, and it is definitely not a linear surface with which it would fit the best. Rather sg like z = a + f(x) + g(y) where probably both f and g are polinomes (hopefully quadratic). Szilvia --

Re: [R] non-linear regression for 3D data

2010-08-11 Thread Duncan Murdoch
On 11/08/2010 6:15 AM, szisziszilvi wrote: Hello! Is there a simplier way in R to get a nonlinear regression (like nls) for a surface? I have 3D data, and it is definitely not a linear surface with which it would fit the best. Rather sg like z = a + f(x) + g(y) where probably both f and g are

Re: [R] non-linear regression for 3D data

2010-08-11 Thread szisziszilvi
oh, god, please don't tell anybody... -- View this message in context: http://r.789695.n4.nabble.com/non-linear-regression-for-3D-data-tp2320982p2321082.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing