Class AhrensDieterMarsagliaTsangGammaSampler

java.lang.Object
org.apache.commons.rng.sampling.distribution.SamplerBase
org.apache.commons.rng.sampling.distribution.AhrensDieterMarsagliaTsangGammaSampler
All Implemented Interfaces:
ContinuousSampler

public class AhrensDieterMarsagliaTsangGammaSampler
extends SamplerBase
implements ContinuousSampler
Sampling from the Gamma distribution.
  • For 0 < theta < 1:
    Ahrens, J. H. and Dieter, U., Computer methods for sampling from gamma, beta, Poisson and binomial distributions, Computing, 12, 223-246, 1974.
  • For theta >= 1:
    Marsaglia and Tsang, A Simple Method for Generating Gamma Variables. ACM Transactions on Mathematical Software, Volume 26 Issue 3, September, 2000.

Sampling uses:

Since:
1.0
  • Constructor Details

    • AhrensDieterMarsagliaTsangGammaSampler

      public AhrensDieterMarsagliaTsangGammaSampler​(UniformRandomProvider rng, double alpha, double theta)
      Parameters:
      rng - Generator of uniformly distributed random numbers.
      alpha - Alpha shape parameter of the distribution.
      theta - Theta scale parameter of the distribution.
      Throws:
      java.lang.IllegalArgumentException - if alpha <= 0 or theta <= 0
  • Method Details