Fitting Gamma to a curve with two peaks

5 ビュー (過去 30 日間)
Xu Zhang
Xu Zhang 2019 年 8 月 11 日
コメント済み: Xu Zhang 2019 年 8 月 12 日
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.

採用された回答

Image Analyst
Image Analyst 2019 年 8 月 11 日
Attached is a demo where I fit two Gaussians. Adapt to your gamma functions.

その他の回答 (1 件)

John D'Errico
John D'Errico 2019 年 8 月 11 日
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 件のコメント
Xu Zhang
Xu Zhang 2019 年 8 月 12 日
Thank you for your help. Now I know what I need.

サインインしてコメントする。

製品


リリース

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by