Class GammaGenerator

All Implemented Interfaces:
NonUniformGenerator

public class GammaGenerator extends AbstractNonUniformGenerator
Procedure to generate variates for gamma distribution.

The method used for generation is based on Marsaglia and Tsang 2000 paper A Simple Method for Generating Gamma Variables

  • Constructor Details

    • GammaGenerator

      public GammaGenerator(RandomGenerator random, double alpha, double theta)
      Simple constructor.
      Parameters:
      random - underlying random generator
      alpha - shape parameter
      theta - scale parameter (this is the inverse of the rate parameter λ)
  • Method Details

    • nextVariate

      public double nextVariate()
      Generate next variate.
      Returns:
      next variate