[SciPy-user] Fitting - Gauss-normal distribution

Anne Archibald peridot.faceted@gmail....
Mon Feb 26 18:52:30 CST 2007

On 26/02/07, David Warde-Farley <david.warde.farley@utoronto.ca> wrote:

> So, it should be noted that the method of moments estimators for a
> Gaussian distribution are also the maximum likelihood estimators, i.e.
> the ones that maximize p(data|parameters), as well as the best least
> square estimator (since taking the log of the density function gives you
> scaled squared distance from the mean). So optimizing iteratively is
> hardly necessary in this case.

Indeed, fitting a Gaussian is pretty easy. If you want to fit
something more sphisticated (even just two Gaussians, for a bimodal
distribution), the way to go is probably not to constuct a histogram
first. A good approach is to fit for a maximum-likelihood estimate.
That is, if you have a pdf f(p1, p2, ..., pn, x) that has n parameters
and gives the probability (density) for x given all those parameters,
set up a nonlinear optimization for the product f(p1, ..., pn,
x1)*...*f(p1, ..., xm).

You are likely to have better numerical behaviour if you instead
minimize the negative logarithm of this.

Anne M. Archibald

More information about the SciPy-user mailing list