Research and Advances
Artificial Intelligence and Machine Learning

Computer generation of gamma random variates with non-integral shape parameters

Posted

When the shape parameter, &agr;, is integral, generating gamma random variables with a digital computer is straightforward. There is no simple method for generating gamma random variates with non-integral shape parameters. A common procedure is to approximately generate such random variables by use of the so-called probability switch method. Another procedure, which is exact, is due to Jöhnk. This paper presents a rejection method for exactly generating gamma random variables when &agr; is greater than 1. The efficiency of the rejection method is shown to be better than the efficiency of Jöhnk's method. The paper concludes that when &agr; is non-integral the following mix of procedures yields the best combination of accuracy and efficiency: (1) when &agr; is less than 1, use Jöhnk's method; (2) when 1 is less than &agr; and &agr; is less than 5, use the rejection method; (3) when &agr; is greater than 5, use the probability switch method.

View this article in the ACM Digital Library.

Join the Discussion (0)

Become a Member or Sign In to Post a Comment

The Latest from CACM

Shape the Future of Computing

ACM encourages its members to take a direct hand in shaping the future of the association. There are more ways than ever to get involved.

Get Involved

Communications of the ACM (CACM) is now a fully Open Access publication.

By opening CACM to the world, we hope to increase engagement among the broader computer science community and encourage non-members to discover the rich resources ACM has to offer.

Learn More