draw.gamma.alpha.greater.than.one: Generates variation from Gamma distribution with alpha>1

Description Usage Arguments Value References Examples

View source: R/draw.gamma.alpha.greater.than.one.R

Description

This function implements pseudo-random number generation for a Gamma distribution for α>1 with pdf

f(x|α,β)=\frac{1}{Γ(α)β^{α}}x^{α-1}e^{-x/β}

for 0 ≤q x < ∞ and \min(α,β)>0 where α and β are the shape and scale parameters, respectively.

Usage

1

Arguments

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.

Value

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.

References

Cheng, R. C. H., & Feast, G. M. (1979). Some simple gamma variate generation. Applied Statistics, 28, 290-295.

Examples

1
2
3
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)

UnivRNG documentation built on Jan. 11, 2018, 1:03 a.m.