フィルターのクリア

What is the most flexible distribution type in histfit?

1 回表示 (過去 30 日間)
Imam
Imam 2014 年 10 月 9 日
コメント済み: José-Luis 2014 年 10 月 9 日
Hi guys,
So I need to make a plot fit from a histogram using histfit. But I can never get a curve which fits closely to my histogram. I have tried almost all distribution type but none of them give satisfactory result. For instance this is the histogram I want to add the fitting to:
In that picture I used kernel dist type. As can be seen the fitted curve should show 4 peaks but it didn't. Any idea how to solve this?

回答 (1 件)

José-Luis
José-Luis 2014 年 10 月 9 日
doc ksdensity
Works if fitting is all you care about.
  2 件のコメント
Imam
Imam 2014 年 10 月 9 日
ksdensity is almost identical to kernel dist type in histfit. I have tried and it gave the same fit curve as above.
José-Luis
José-Luis 2014 年 10 月 9 日
Then I am sorry, but I don't understand what you want to achieve. If you want the curve to look exactly like the histogram, then don't plot the frequencies as a histogram but as a line.
Alternatively, pass the points where you want the density to be evaluate to ksdensity:
a = randn(10000,1);
[f,xi] = ksdensity(a,-5:5);
plot(xi,f,'r-','LineWidth',2);
[f xi] = ksdensity(a,-5:0.1:5)
plot(xi,f,'g-','LineWidth',2);

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

Community Treasure Hunt

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

Start Hunting!

Translated by