Re: [R] fitting a histogram to a Gaussian curve

2012-03-19 Thread Vihan Pandey
I'll check it out, thanks a million Micheal! On 19 March 2012 19:59, R. Michael Weylandt wrote: > Take a look at fitdistr in the MASS package. > > fitdistr(x, "normal") > > I don't think you need to supply start values for the normal since its > loglikelihood function is nicely behaved. You may n

Re: [R] fitting a histogram to a Gaussian curve

2012-03-19 Thread R. Michael Weylandt
Take a look at fitdistr in the MASS package. fitdistr(x, "normal") I don't think you need to supply start values for the normal since its loglikelihood function is nicely behaved. You may need to for harder distributions. Michael On Mon, Mar 19, 2012 at 2:54 PM, Vihan Pandey wrote: > I see, th

Re: [R] fitting a histogram to a Gaussian curve

2012-03-19 Thread Vihan Pandey
I see, that could be an option, however isn't there a fitting function which would do that on given data? On 19 March 2012 19:49, R. Michael Weylandt wrote: > If I understand you correctly, a univariate Gaussian distribution is > uniquely determined by its first two moments so you can just fit th

Re: [R] fitting a histogram to a Gaussian curve

2012-03-19 Thread R. Michael Weylandt
If I understand you correctly, a univariate Gaussian distribution is uniquely determined by its first two moments so you can just fit those directly (using sample mean for population mean and sample variance with Besel's correction for population variance) and get the "best" Gaussian (in a ML sense

[R] fitting a histogram to a Gaussian curve

2012-03-19 Thread Vihan Pandey
Hello, I am trying to fit my histogram to a smooth Gaussian curve(the data closely resembles one except a few bars). This is my code : #!/usr/bin/Rscript out_file = "irc_20M_opencl_test.png" png(out_file) scan("my.csv") -> myvals hist(myvals, breaks = 50, main = "My Distribution",xlab = "My V