Hello all,
We know by definition that a pdf must integrate to 1, but I'm finding in my code that this is not the case for a pdf I create using lognpdf and I am wondering why. Can you please help me?
increment = 0.01 ;x = 0:increment:1 ;mean_val = 0.25 ;sigma_val = 0.69 ;y = lognpdf(x,mean_val,sigma_val) ;>> trapz(x,y)ans = 0.358554747437567
You can see that the integral (approximated by the trapezoidal method) is significantly below 1. Why?
Best Answer