Gamma Distribution - Generating Gamma-distributed Random Variables

Generating Gamma-distributed Random Variables

Given the scaling property above, it is enough to generate gamma variables with as we can later convert to any value of with simple division.

Using the fact that a distribution is the same as an distribution, and noting the method of generating exponential variables, we conclude that if is uniformly distributed on, then − is distributed Now, using the "α-addition" property of gamma distribution, we expand this result:

where are all uniformly distributed on and independent. All that is left now is to generate a variable distributed as for and apply the "α-addition" property once more. This is the most difficult part.

Random generation of gamma variates is discussed in detail by Devroye, noting that none are uniformly fast for all shape parameters. For small values of the shape parameter, the algorithms are often not valid. For arbitrary values of the shape parameter, one can apply the Ahrens and Dieter modified acceptance-rejection method Algorithm GD (shape k ≥ 1), or transformation method when 0 < k < 1. Also see Cheng and Feast Algorithm GKM 3 or Marsaglia's squeeze method.

The following is a version of the Ahrens-Dieter acceptance-rejection method:

  1. Let be 1.
  2. Generate, and as independent uniformly distributed on variables.
  3. If, where, then go to step 4, else go to step 5.
  4. Let . Go to step 6.
  5. Let .
  6. If, then increment and go to step 2.
  7. Assume to be the realization of .

A summary of this is

where

  • is the integral part of ,
  • has been generated using the algorithm above with (the fractional part of ),
  • and are distributed as explained above and are all independent.

Read more about this topic:  Gamma Distribution

Famous quotes containing the words random and/or variables:

    Man always made, and still makes, grotesque blunders in selecting and measuring forces, taken at random from the heap, but he never made a mistake in the value he set on the whole, which he symbolized as unity and worshipped as God. To this day, his attitude towards it has never changed, though science can no longer give to force a name.
    Henry Brooks Adams (1838–1918)

    The variables are surprisingly few.... One can whip or be whipped; one can eat excrement or quaff urine; mouth and private part can be meet in this or that commerce. After which there is the gray of morning and the sour knowledge that things have remained fairly generally the same since man first met goat and woman.
    George Steiner (b. 1929)