[R] Problem with dgamma ?

Tong Wang wangtong at usc.edu
Mon Apr 23 05:59:59 CEST 2007


Hi All, 
     Here 's what I got using dgamma function : 

> nu<-.2
> nu*log(nu)-log(gamma(nu))+(nu-1)*log(1)-nu*(1)
[1] -2.045951

> dgamma(1,nu,nu,1)
[1] 0.0801333

> dgamma(1,nu,nu,0)
[1] NaN
Warning message:
NaNs produced in: dgamma(x, shape, scale, log) 

Could anyone tell me what is wrong here ?
I am using R-2.4.1 on windows XP.

Thanks a lot.



More information about the R-help mailing list