[R] {spam?} Nonlinear Regression

Martin Henry H. Stevens stevenmh at muohio.edu
Mon Jun 11 12:47:41 CEST 2007


Hi tronter,

PLEASE do read the posting guide http://www.R-project.org/posting- 
guide.html
and provide commented, minimal, self-contained, reproducible code.

Hank
On Jun 7, 2007, at 5:50 PM, tronter wrote:

>
> 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.
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting- 
> guide.html
> and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list