[Rd] rgamma gives zeros. (PR#9184)

pxi at stat.cmu.edu pxi at stat.cmu.edu
Tue Aug 29 18:40:45 CEST 2006


Full_Name: Peiyi Xi
Version: R 2.2.0
OS: Windows XP Professional
Submission from: (NULL) (128.2.3.141)


When I use rgamma(n, shape, rate ) to generate gamma samples, it
gives zeros when both shape and rate are very small.

But we know that if x follows a gamma distribution, x should be positive.

e.g.
> temp=rgamma(10, 0.001, rate=0.01)
> temp
 [1]  2.438078e-33 5.101136e-130  1.760830e-54 2.724731e-166  0.000000e+00
 [6] 4.461151e-146  1.332914e-55 2.336396e-277  0.000000e+00  0.000000e+00
> temp[5]
[1] 0



More information about the R-devel mailing list