Re: fitting mixed gaussians [message #44138 is a reply to message #44135] |
Tue, 17 May 2005 12:55   |
Rob Dimeo
Messages: 17 Registered: November 1999
|
Junior Member |
|
|
Thanks for the plug, David. Yep, PAN is just a big GUI wrapper for
MPCURVEFIT. In fact the kind of fitting described in the original post
is done routinely at our neutron scattering facility where the whole
model function can be composed of many Gaussians, Lorentzians,
Lognormals, etc.
I should also mention that PAN has been updated to include an
alternative error estimation based on the *bootstrap Monte-Carlo*
method which can be useful for fitting functions that are highly
non-linear in the fit parameters. There is a discussion of this in
Numerical Recipes for those intereseted.
Rob
David Fanning wrote:
> Ben Tupper writes:
>
>> I would like to employ a "mixed gaussian" fitting routine that fits
not
>> just one peak in a distribution but rather fits any number of
peaks.
>> According to my old Gonzales and Woods Image Processing book this
>> technique is used in Bayesian classifier - in the two class problem
the
>> saddle of the two fitted curves is used as the point around which
the
>> classes are separated. I just to segment simple grayscale images
with it
>> usiing the histogram as the data to model.
>>
>> Using GAUSSFIT or MPFIT it's very easy to fit one (the tallest)
peak
>> shown in the example (see code example below.) But how the heck
to fit
>> the second peak? I have scoured the internet and find much
written
>> about it - but it is all in Greek. Really. Yikes.
>>
>> Is it possible to make the curve fitting routines I have on hand to
fit
>> two gaussian models?
>
> Craig is going to fill you in on all the details of this,
> using MPFIT, but I just wanted to mention that Rob Dimeo's
> PAN program is super for allowing you to fit as many curves
> as you like onto a set of data interactively.
>
> http://www.ncnr.nist.gov/staff/dimeo/panweb/pan.html
>
> Just draw and adjust the initial curve parameters on
> the data itself, then go fit it with a click of the button.
> Of course, it is simply a wrapper for MPFIT. The tutorial
> Rob has provided is helpful for getting started.
>
> Cheers,
>
> David
>
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|