Why does my log-normal distribution not fit my data?
古いコメントを表示
Hello,
I am fitting some realively simple data with a log normal distribution.
I am then generating a probability distribution from that fit.
Shouldn't this roughly match the intial data?
when I plot it on top of normalized histogram of the data, the shape is appropriate but the scale is about ten-fold lower.
Example below.
parmat = lognfit(data)
pdf = lognpdf(0:1:1000,parmat(1),parmat(2))
figure;hold on
histogram(data,[0:1:1000],'normalization','probability')
plot(0:1:1000,pdf)
In this case shouldn't the probability density function approximate the histrogam, rather than being one tenth or less the values of the histogram probability?
Thanks.
1 件のコメント
dpb
2018 年 12 月 4 日
Seems reasonable; probably need to see what data are to be able to decipher what actually happened.
採用された回答
その他の回答 (1 件)
Jeff Miller
2018 年 12 月 4 日
0 投票
The probability density function should only approximate the histogram in shape, not in height. Remember, the PDF is defined such that it's total area (integral) is 1, over the whole range of the random variable. The total area under the histogram is much more than that.
3 件のコメント
David McVea
2018 年 12 月 4 日
Jeff Miller
2018 年 12 月 4 日
Yes, I think so. According to the docs, that normalization produces a sum of the bar heights equal to 1. But the integral depends on the range along the horizontal axis as well as on the bar heights.
David McVea
2018 年 12 月 5 日
カテゴリ
ヘルプ センター および File Exchange で Exploration and Visualization についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

