draw.gamma.alpha.greater.than.one {UnivRNG} | R Documentation |
\alpha>1
This function implements pseudo-random number generation for a Gamma distribution for \alpha>1
with pdf
f(x|\alpha,\beta)=\frac{1}{\Gamma(\alpha)\beta^{\alpha}}x^{\alpha-1}e^{-x/\beta}
for 0 \leq x < \infty
and \min(\alpha,\beta)>0
where \alpha
and \beta
are the shape and scale parameters, respectively.
draw.gamma.alpha.greater.than.one(nrep,alpha,beta)
nrep |
Number of data points to generate. |
alpha |
Shape parameter for desired gamma distribution. Must be greater than 1. |
beta |
Scale parameter for desired gamma distribution. |
A list of length five containing generated data, the theoretical mean, the empirical mean, the theoretical variance, and the empirical variance with names y, theo.mean, emp.mean, theo.var, and emp.var, respectively.
Cheng, R. C. H., & Feast, G. M. (1979). Some simple gamma variate generation. Applied Statistics, 28, 290-295.
draw.gamma.alpha.greater.than.one(nrep=100000,alpha=2,beta=2)
draw.gamma.alpha.greater.than.one(nrep=100000,alpha=3,beta=0.4)