gaussian fit to the data

5 ビュー (過去 30 日間)
Megha
Megha 2019 年 4 月 16 日
コメント済み: Torsten 2019 年 4 月 16 日
I have my data like
x = 1:1934;
y = (Attached below);
To fit a gaussian distribution, I used
figure; plot(x,y);
myfittype = fittype('B.*exp(-(x-mu).^2/(2*sigma^2))',...
'dependent',{'y'},'independent',{'x'},'coefficients',...
{'B','mu','sigma'}); %
[myfit2, goodness2, output2] = fit(x,y,myfittype);
hold on;
plot(myfit2,x,y);
Even though it fits very incorrectly, I can see a Warning: Start point not provided, choosing random start point.
Ideally, alongwith mu and sigma, coefficent B should also be generated automatically while running fittype. However, it does not.
Any suggestions to improve it?
  1 件のコメント
Torsten
Torsten 2019 年 4 月 16 日
I think you mix up "maximum likelihood estimates" and "curve fitting".
Take a look at
https://de.mathworks.com/help/stats/mle.html

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

回答 (0 件)

カテゴリ

Help Center および File ExchangeLinear and Nonlinear Regression についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by