Why does lognpdf not integrate to 1?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Jessica
el 25 de Oct. de 2014
Comentada: Jessica
el 25 de Oct. de 2014
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?
0 comentarios
Respuesta aceptada
the cyclist
el 25 de Oct. de 2014
Doesn't it integrate to 1 over the interval [0,infinity], not [0,1]?
Más respuestas (0)
Ver también
Categorías
Más información sobre Numerical Integration and Differentiation en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!