问题
Folks,i have been trying to obtain a Gaussian fit for some data sets which somehow look like a distorted normal distribution.I have been using software to do that. I wonder if i can apply an iterative algorithm to convert these data sets to a Gaussian fitted curve,the standard deviation and mean of the original curve being the inputs.? Any ideas?
回答1:
- Calculate the mean of the data:
mu = 1/N Sum(xi)
- Calculate the dispersion of the data:
sigma = sqrt(1/(N-1) Sum(xi-mu))
- Fill in the parameters:
gauss = 1/(sigma*sqrt(2pi)))*exp(-1/2*((x-mu)/sigma)^2)
I don't see any need for fitting the beast with the easy math involved.
来源:https://stackoverflow.com/questions/10950733/gaussian-curve-fitting-algorithm