[R] fitting a gaussian to some x,y data

Michael Koppelman michael at isis.spa.umn.edu
Sat Aug 26 21:55:00 CEST 2006


Whoops, I forgot to add, many thanks to all who replied publicly and  
privately. I am very appreciative of all comments and suggestions.  
Mark Leeds was especially kind in terms of clarifying why my  
description of the situation was so confusing.

Cheers,
Michael

On Aug 26, 2006, at 2:51 PM, Michael Koppelman wrote:

> Success! The line I needed was:
>
> gcoeffs <-nls(y~(a/b)*exp(-(x-c)^2/(2*b^2)),start=list 
> (a=0.4,b=2,c=-10), trace=TRUE)
>
> I also needed to provide good guesses for a, b and c. The attached  
> PNG should explain what I was going after, which is the line in the  
> center of that curve. I am sorry for my confusing and perhaps  
> incorrect usage of terminology.
>
> Cheers,
> Michael



More information about the R-help mailing list