Area under a PDF curve
16 次查看(过去 30 天)
显示 更早的评论
Hi all!
I have a brief question. I am trying to obtain the area under a PDF curve. Concretely, the PDF follows a Lognormal distribution with paremeter mu=0 and sigma=0.9.
zmax=10;
gridz=600;
m=0;
sig=0.9;
z=logspace(0,log(zmax)/log(10),gridz);
g=lognpdf(z,m,sig);
trapz(z,g)
However, the value I obtain is equal to 0.49, far from 1. Any advise please?
Thanks in advanced,
Ibai
5 个评论
回答(1 个)
Chunru
2022-3-3
For pdf that matlab supports, you can use cdf function to find the area under pdf. For your case
zmax=10;
m=0;
sig=0.9;
logncdf(zmax, m, sig)
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!