Problem with ksdensity with Inverse gamma(0.001, 0.001)

조회 수: 1 (최근 30일)
Fio
Fio 2015년 7월 19일
댓글: Brendan Hamm 2015년 7월 20일
Hello! I am trying to plot the ksdensity of an Inverse gamma(0.001, 0.001) but the plot has only one point. The commands I used are
alpha1 = 0.001;
beta1 = 0.001;
n = 1e+5;
r=1./gamrnd(alpha1,1/beta1,n,1);
[f,xi] = ksdensity(r);
plot(xi,f,'--m');
The first term of f is a real number and all the others are NaN. The first term of xi is a real number and all the others are Inf.
Could you please me help me with this.
Thank you very much.
  댓글 수: 1
Brendan Hamm
Brendan Hamm 2015년 7월 20일
With these values of alpha and beta almost all weight in the gamma distribution is near zero. Therefore your r values are very likely to be Inf.

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

답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by