필터 지우기
필터 지우기

Why does lognpdf not integrate to 1?

조회 수: 2 (최근 30일)
Jessica
Jessica 2014년 10월 25일
댓글: Jessica 2014년 10월 25일
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?

채택된 답변

the cyclist
the cyclist 2014년 10월 25일
Doesn't it integrate to 1 over the interval [0,infinity], not [0,1]?
  댓글 수: 1
Jessica
Jessica 2014년 10월 25일
Ugh. You're right. I had been working with Beta distributions the whole time before this, so my frame of reference was skewed. That's silly.
Now, how to get the lognormal pdf to behave the way I want it to between 0 and 1...anyway, thank you.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Numerical Integration and Differentiation에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by