Hi, I am looking for a way to fit data (vector of values) to a density function using an optimization (ordinary least squares or maximum likelihood fit). For example if I have a vector of 100 values generated with rnorm:
rnorm(n=100,mean=500,sd=50) How can I fit these data to a Gaussian density function to extract the mean and sd value of the underlying normal distribution. So the result should roughly meet the parameters of the normal distribution used to generate the data. The results will ideally be closer the true parameters the more data (n) are used to optimize the density function. Any suggestions? /Johannes [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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.