[R] Nonlinear Regression
tronter
pev340002003 at yahoo.com
Thu Jun 7 23:50:12 CEST 2007
Hello
I followed the example in page 59, chapter 11 of the 'Introduction to R'
manual. I entered my own x,y data. I used the least squares. My function has
5 parameters: p[1], p[2], p[3], p[4], p[5]. I plotted the x-y data. Then I
used lines(spline(xfit,yfit)) to overlay best curves on the data while
changing the parameters. My question is how do I calculate the residual sum
of squares. In the example they have the following:
df <- data.frame( x=x, y=y)
fit <- nls(y ~SSmicmen(s, Vm, K), df)
fit
In the second line how would I input my function? Would it be:
fit <- nls(y ~ myfunction(p[1], p[2], p[3], p[4], p[5]), df) where
myfunction is the actual function? My function doesnt have a name, so should
I just enter it?
Thanks
--
View this message in context: http://www.nabble.com/Nonlinear-Regression-tf3886617.html#a11016968
Sent from the R help mailing list archive at Nabble.com.
More information about the R-help
mailing list