How to calculate the 95% (area under the curve) of Kernel probability density curve?

4 ビュー (過去 30 日間)
Andi
Andi 2022 年 7 月 10 日
コメント済み: Andi 2022 年 7 月 16 日
Hi everyone,
I require to plot the kernel density curve and mark its 5% and 95% values on the plot. I attempted but not working (my script is attached) May someone suggest to me how can I fix this?
raw=readmatrix('5_95.csv');
a=raw(:,4);
figure(1)
pdSix = fitdist(a,'Kernel','Width',0.5);
x = -5:0.01:5;
ySix = pdf(pdSix,x);
plot(x,ySix,'k-','LineWidth',2)
The espected output should be like this.

採用された回答

Paul
Paul 2022 年 7 月 10 日
編集済み: Paul 2022 年 7 月 10 日
The function icdf can find the values of x such that P(X < x) = 0.05 and 0.95.
Use those values with xline to add the vertical lines to the plot.
  5 件のコメント
Paul
Paul 2022 年 7 月 16 日
According to fitdist
pdSix = fitdist(SixMPG,'Kernel','Kernel,',kernel,'Width',4);
where kernel is one of:
  • 'normal'
  • 'box'
  • 'triangle'
  • 'epanechnikov'
Andi
Andi 2022 年 7 月 16 日
Thankl you very much !

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

その他の回答 (0 件)

カテゴリ

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

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by