The Monty Python method for generating gamma variables

4Citations
Citations of this article
15Readers
Mendeley users who have this article in their library.

Abstract

The Monty Python Method for generating random variables takes a decreasing density, cuts it into three pieces, then, using area-preserving transformations, folds it into a rectangle of area 1. A random point (x, y) from that rectangle is used to provide a variate from the given density, most of the time as x itself or a linear function of x. The decreasing density is usually the right half of a symmetric density. The Monty Python method has provided short and fast generators for normal, t and von Mises densities, requiring, on the average, from 1.5 to 1.8 uniform variables. In this article, we apply the method to non-symmetric densities, particularly the important gamma densities. We lose some of the speed and simplicity of the symmetric densities, but still get a method for γα variates that is simple and fast enough to provide beta variates in the form γa(γa + γb). We use an average of less than 1.7 uniform variates to produce a gamma variate whenever α ≥ 1. Implementation is simpler and from three to five times as fast as a recent method reputed to be the best for changing α's.

Cite

CITATION STYLE

APA

Marsaglia, G., & Tsang, W. W. (1998). The Monty Python method for generating gamma variables. Journal of Statistical Software, 3, 1–8. https://doi.org/10.18637/jss.v003.i03

Register to see more suggestions

Mendeley helps you to discover research relevant for your work.

Already have an account?

Save time finding and organizing research with Mendeley

Sign up for free