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

Michael Koppelman michael at isis.spa.umn.edu
Fri Aug 25 21:35:31 CEST 2006


Thank you. Yes, I do feel that I am under-qualified to even ask  
questions of y'all. Plus I'm an astronomer, which doesn't help! ;)  
I'll try again.

I have two columns of data, the first column (x) is a distance (or  
length or separation) and the second column (y) is a flux (or number  
of counts or brightness) at that distance. Thus, when you plot y vs.  
x you get a spatial profile which shows how bright this thing is as a  
function of position. (See the small, attached PNG file. You can see  
there is a vague gaussian shape to the data.) This is measured data  
from a bizarre technique which yields data that is not evenly-spaced  
in x and it does not represent a pure mathematical function (i.e. it  
is not a point spread function or something like that), it represents  
the actual, non-uniform shape of an astronomical object. We are  
making the assumption that the shape of this object can be roughly  
represented with a gaussian.

I want to fit a gaussian to this with the purpose of determining  
systematically the "center" of the normal-like shape of the spatial  
feature. I have successfully done so in R with a polynomial but I  
can't figure out how to do it with a gaussian.

Does that make sense?

Thanks!
Michael


On Aug 25, 2006, at 2:04 PM, MARK LEEDS wrote:

> hi : i'm not clear on what you mean but someone else might be ? if you
> say ( x,y), then it sounds like you are talking about a bivariate  
> normal
> distribution. to fit a regular one dimensional gaussian distribution,
> you can't have 2 dimensional data. i honestly don't mean to sound  
> rude but
> i think you should explain what you want to do  more clearly  
> because I don't think
> I am the only one that will be confused by what you said.
> send out a clearer email and you will get quite a response because
> there are a lot of really smart people ( compared to me ) on this  
> list  that love to help.
> it's an amazing list in that sense.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: example.png
Type: image/png
Size: 15487 bytes
Desc: not available
Url : https://stat.ethz.ch/pipermail/r-help/attachments/20060825/4d0aedbb/attachment.png 


More information about the R-help mailing list