# A simple method for generating gamma variables

@article{Marsaglia2000ASM, title={A simple method for generating gamma variables}, author={George Marsaglia and Wai Wan Tsang}, journal={ACM Trans. Math. Softw.}, year={2000}, volume={26}, pages={363-372} }

We offer a procedure for generating a gamma variate as the cube of a suitably scaled normal variate. It is fast and simple, assuming one has a fast way to generate normal variables. In brief: generate a normal variate <italic>x</italic> and a uniform variate <italic>U</italic> until In (<italic>U</italic>)<0.5<italic>x</italic><supscrpt>2</supscrpt> + <italic>d</italic> - <italic>dv</italic> + <italic>d</italic>ln(italic>v</italic>), then return <italic>dv</italic>. Here, the gamma parameter is… Expand

#### 192 Citations

The double CFTP method

- Mathematics, Computer Science
- TOMC
- 2011

An algorithm that can be automated under the condition that it has a source capable of generating independent copies of<i>Y</i>, and that <i>V</i> has a density that can been evaluated in a black-box format is given. Expand

AN IMPROVEMENT OF MINH’S ALGORITHM FOR GENERATING GAMMA VARIATES WITH ANY VALUE OF SHAPE PARAMETER

- 2014

The algorithm of Minh as in [Minh (1988)] was used to generate variates having a gamma distribution with shape parameter a>1 only. In this paper, a method, which is the improvement of the algorithm… Expand

Generalized Ziggurat Algorithm for Unimodal and Unbounded Probability Density Functions with Zest

- Mathematics, Physics
- 2018

We present a modified Ziggurat algorithm that could generate a random number from all unimodal and unbounded PDFs. For PDFs that have unbounded density and/or unbounded support we use a combination… Expand

A Simple Gamma Random Number Generator for Arbitrary Shape Parameters

- Mathematics
- 2008

This paper proposes an improved gamma random generator. In the past, a lot of gamma random number generators have been proposed, and depending on a shape parameter (say, alpha) they are roughly… Expand

A novel stochastic model and fast generation method for Nakagami fading channels

- Mathematics
- 2007 Conference Record of the Forty-First Asilomar Conference on Signals, Systems and Computers
- 2007

Nakagami fading channels are widely accepted to model a variety of wireless channels. They are parameterized by the m-factor, which can take on any value m > 0. The case m = 1 subsumes Rayleigh… Expand

Efficient and Accurate Parallel Inversion of the Gamma Distribution

- Mathematics, Computer Science
- SIAM J. Sci. Comput.
- 2015

A method for parallel inversion of the gamma distribution is described, which has accuracy close to a choice of single- or double-precision machine epsilon for random number generation in Monte Carlo simulations where gamma variates are required. Expand

Fitting distributions using maximum likelihood: Methods and packages

- Mathematics, Medicine
- Behavior research methods, instruments, & computers : a journal of the Psychonomic Society, Inc
- 2004

The general approach to performing distribution fitting with maximum likelihood (ML) and a method based on quantiles (quantile maximum probability, QMP) are reviewed and it is shown that QMP has both small bias and good efficiency when used with common distribution functions. Expand

Logarithmic Transformation-Based Gamma Random Number Generators

- Mathematics
- 2013

Developing efficient gamma variate generators is important for Monte Carlo methods. With a brief review of existing methods for generating gamma random numbers, this article proposes two simple gamma… Expand

Rejection Sampling for an Extended Gamma Distribution

- 2011

We propose and analyze rejection samplers for simulating from an extended Gamma distribution. This distribution is supported on (0,∞) and has density proportional to tα−1 exp(−t − 2 √ tγ), where α… Expand

Simulating from a gamma distribution with small shape parameter

- Mathematics
- 2013

The gamma distribution with small shape parameter can be difficult to characterize. For this reason, standard algorithms for sampling from such a distribution are often unsatisfactory. In this paper,… Expand

#### References

SHOWING 1-10 OF 16 REFERENCES

Some Simple Gamma Variate Generators

- Mathematics
- 1979

SUMMARY Gamma variates with index a> 1 are produced by combining two adaptations of Kinderman and Monahan's technique for generating random variates by the use of the ratio of uniform variates.… Expand

The Monty Python Method for Generating Gamma Variables

- Mathematics
- 1999

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… Expand

Non-Uniform Random Variate Generation

- Mathematics
- 1986

This is a survey of the main methods in non-uniform random variate generation, and highlights recent research on the subject. Classical paradigms such as inversion, rejection, guide tables, and… Expand

The Monty Python method for generating random variables

- Mathematics, Computer Science
- TOMS
- 1998

We suggest an interesting and fast method for generating normal, exponential, t, von Mises, and certain other important random variables used in Monte Carlo studies. The right half of a symmetric… Expand

Squeeze Methods for Generating Gamma Variates

- Mathematics
- 1980

Abstract Two algorithms are given for generating gamma distributed random variables. The algorithms, which are valid when the shape parameter is greater than one, use a uniform majorizing function… Expand

Generating gamma variates by a modified rejection technique

- Mathematics, Computer Science
- CACM
- 1982

A modification of the rejection technique begins by sampling from the normal distribution, being able to accept and transform the initial normal observation quickly at least 85 percent of the time. Expand

A Fast, Easily Implemented Method for Sampling from Decreasing or Symmetric Unimodal Density Functions

- Computer Science
- 1984

A new method is described, suitable for any decreasing or symmetric unimodal density, that is faster and more easily implemented, thereby providing a standard procedure for developing both the fast and the slow part for many given densities. Expand

The exact-approximation method for generating random variables

- Mathematics
- 1984

Abstract A suitably chosen approximation to the inverse of a probability distribution can lead to exact and very fast methods for generating random variables, if the approximation is made exact by… Expand

The Ziggurat Method for Generating Random Variables

- Mathematics
- 2000

We provide a new version of our ziggurat method for generating a random variable from a given decreasing density. It is faster and simpler than the original, and will produce, for example, normal or… Expand

The squeeze method for generating gamma variates

- Mathematics
- 1977

Abstract This paper describes an exact method for computer generation of random variables with a gamma distribution. The method is based on the Wilson-Hilferty transformation and an improvement on… Expand