请问如何根据积分值求积分上限。

现有一个函数x=[randn(30,1);5+randn(30,1)];[f,xi]=ksdensity(x);
figure()
subplot(211);
plot(x);
title('样本数据(Sample Data)');
subplot(212);
plot(xi,f);
title('概率密度分布(PDF)');
现在已经知道了概率密度分布曲线,我想求累计概率值为0.8的那个点,请问如何求,谢谢大神指点。

 采纳的回答

dacayog
dacayog 2022-11-17

0 个投票

1、简单地用prctile 。
x=[randn(30,1);5+randn(30,1)];
prctile(x,80);
ans =5.1951
2、用PDF的话,解方程。
ksdesity得到的是离散的,用fitdist中的Kernel来拟合
x=[randn(30,1);5+randn(30,1)];
pd = fitdist(x,'Kernel');
fzero(@(x)cdf(pd,x)-0.8,5)
ans =5.4071

更多回答(0 个)

标签

Community Treasure Hunt

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

Start Hunting!