fitting a lognormal curve into a histogram

14 ビュー (過去 30 日間)
cgo
cgo 2017 年 10 月 5 日
コメント済み: Monika Kolarova 2022 年 2 月 11 日
Hi,
I have a histogram that looks like the one below. I want to fit a lognormal curve (I think a sum of two log normal curves with different sigmas). I am not sure how to do it.
Thanks

採用された回答

KSSV
KSSV 2017 年 10 月 5 日
% Make up some data. (You should use your real data in place of x.)
x = lognrnd(1,0.3,10000,1);
% Fit the data
parmhat = lognfit(x);
% Plot comparison of the histogram of the data, and the fit
figure
hold on
% Empirical distribution
hist(x,0.1:0.1:10);
% Fitted distribution
xt = 0.1:0.1:10;
plot(xt,1000*lognpdf(xt,parmhat(1),parmhat(2)),'r')
  1 件のコメント
Monika Kolarova
Monika Kolarova 2022 年 2 月 11 日
I have similar problem - need to fit lognormal curve to a histogram. I guess this code is for fitting the unsorted data. How can one do this fitting when the categories and bincounts are known?

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeHistograms についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by