Fitting Gamma to a curve with two peaks

4 Ansichten (letzte 30 Tage)
Xu Zhang
Xu Zhang am 11 Aug. 2019
Kommentiert: Xu Zhang am 12 Aug. 2019
untitled.png
I have a curve with two peaks and I want to fit it using sum of two Gamma function. But I don't know how to do it. Thanks for your help.

Akzeptierte Antwort

Image Analyst
Image Analyst am 11 Aug. 2019
Attached is a demo where I fit two Gaussians. Adapt to your gamma functions.

Weitere Antworten (1)

John D'Errico
John D'Errico am 11 Aug. 2019
This is a mistake that many people make.
They know how to fit a model to a curve. But the model they know how to use does not fit, so they try some other model form, for no real good reason for the choice, except that it might work. When that happens, I suggest they have made a mistake, because they had no physical reason for the choice of model, they just picked some form out of the blue.
In that case, the solution is often to recognize that splines are a great choice. You can use an interpolating spline, although when you have a baseline as you do, pchip may be a better choice. If you want to do some smoothing, then my SLM toolbox can offer that, while still offering the ability to not go below the baseline, etc.
The important point is to know why you want to fit a given model. Do you just want a smooth plot? USE A SPLINE! Do you just want something you can use for computations, to make predictions? Again, use a spline! Do you really need to be able to write down a model, with some coefficients? (WHY?)
Don't fit a model for the wrong reasons.
  1 Kommentar
Xu Zhang
Xu Zhang am 12 Aug. 2019
Thank you for your help. Now I know what I need.

Melden Sie sich an, um zu kommentieren.

Produkte


Version

R2019a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by