Fit two peak model
古いコメントを表示
I wonder if it is possible to fit a familiar model to this data?

My first thought tends to use the mixed Gaussian model to fit a bimodal distribution. I don't know if it can work, please give some advice. Also, is there any other distribution that I can use to fit this data more properly?
1 件のコメント
Walter Roberson
2020 年 6 月 28 日
Possibly gauss2 from curve fitting toolbox? https://www.mathworks.com/help/curvefit/list-of-library-models-for-curve-and-surface-fitting.html
採用された回答
その他の回答 (1 件)
Image Analyst
2020 年 6 月 28 日
1 投票
I've attached code, fit_two_Gaussians.m, to find two Gaussians with a slope in the x direction (to give a slightly better fit). Replace the demo (x,y) with your (x,y) and it will fit your data.

I'm also attaching a demo that fits any number of Gaussians to the data. The demo uses 6 Gaussians but you can tell it how many you want it to find.
4 件のコメント
cliffy
2020 年 6 月 30 日
Image Analyst
2020 年 6 月 30 日
No, that's not correct. It's a 1-D situation.
I have an independent variable X, and for that I have one dependent variable Y, not two. So it's a 1-D situation.
It's not a 2-D situation, which would be like you're trying to fit 2-D Gaussians to "spots" or "humps" in a 2-D grayscale image. Realize that x,y is a 1-D situation while x,y and intensity (z) is a 2-D situation. 2-D data would be like I had an intensity for an x, y pair on an image.
cliffy
2020 年 6 月 30 日
Image Analyst
2020 年 6 月 30 日
What you call x is the dependent variable. So in your case the independent variable would simply be the index. So to make your data be x,y, you'd do
y = x; % Make a copy of the x variable in a variable called y.
x = 1 : length(y); % The x, or independent variable, is simply the index number.
カテゴリ
ヘルプ センター および File Exchange で Fit Postprocessing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!