The Monty Python Method for Generating Gamma Variables
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 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 gamma_alpha variates that is simple and fast enough to provide beta variates in the form gamma_a/(gamma_a+gamma_b). We use an average of less than 1.7 uniform variates to produce a gamma variate whenever alpha >= 1 . Implementation is simpler and from three to five times as fast as a recent method reputed to be the best for changing alpha's.
Year of publication: |
1999-01-08
|
---|---|
Authors: | Marsaglia, George ; Tsang, Wai Wan |
Published in: |
Journal of Statistical Software. - American Statistical Association. - Vol. 03.1999, i03
|
Publisher: |
American Statistical Association |
Saved in:
Saved in favorites
Similar items by person
-
Fast Generation of Discrete Random Variables
Marsaglia, George, (2004)
-
Some Difficult-to-pass Tests of Randomness
Marsaglia, George, (2002)
-
The Ziggurat Method for Generating Random Variables
Marsaglia, George, (2000)
- More ...