Name

gamm_rnd — Gamma random draws

CALLING SEQUENCE

[gb]=gamm_rnd(nrow,ncol,m,k)

PARAMETERS

Input

• nrow,ncol = the size of the matrix drawn

• m = a parameter such that the mean of the gamma = m/k

• k = a parameter such that the variance of the gamma = m/(k^2)

Output

• r = an nrow x ncol matrix of random numbers from the gamma distribution

DESCRIPTION

Performs a matrix of random draws from the gamma distribution. REFERENCE: Luc Devroye, Non-Uniform Random Variate Generation, New York: Springer Verlag, 1986, ch 9.3-6. Note: m=r/2, k=2 equals chisq r random deviate.

EXAMPLE

x=gamm_rnd(5,4,3,3)

               

AUTHOR

Eric Dubois 2002