新手,请教老师答疑!!!matlab中的ksdensity函数可以估计概率密度函数,那么可以该函数求的概率密度求某一区间范围的概率值吗?如果想求概率值应该怎么做?(我有很多采集的样本值想求概率)

 채택된 답변

jatecos
jatecos 2022년 11월 21일

0 개 추천

核密度估计本身是有表达式的,它的表达式取决于你用什么核函数
当然,你只是计算定积分,跟有没有表达式没有关系,只要有数值即可。举个例子:
data = normrnd(1,2,100000,1);
pdfEst = @(x)ksdensity(data,x);
mu = integral(@(x) x.*pdfEst (x),-Inf, Inf)
Var = integral(@(x) (x-mu).^2.*pdfEst (x),-Inf, Inf)

추가 답변 (0개)

카테고리

태그

질문:

2022년 11월 21일

답변:

2022년 11월 21일

Community Treasure Hunt

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

Start Hunting!