Class AhrensDieterMarsagliaTsangGammaSampler.BaseGammaSampler

java.lang.Object
org.apache.commons.rng.sampling.distribution.AhrensDieterMarsagliaTsangGammaSampler.BaseGammaSampler
All Implemented Interfaces:
ContinuousSampler, SharedStateContinuousSampler, SharedStateSampler<SharedStateContinuousSampler>
Direct Known Subclasses:
AhrensDieterMarsagliaTsangGammaSampler.AhrensDieterGammaSampler, AhrensDieterMarsagliaTsangGammaSampler.MarsagliaTsangGammaSampler
Enclosing class:
AhrensDieterMarsagliaTsangGammaSampler

private abstract static class AhrensDieterMarsagliaTsangGammaSampler.BaseGammaSampler extends Object implements SharedStateContinuousSampler
Base class for a sampler from the Gamma distribution.
  • Field Details

    • rng

      protected final UniformRandomProvider rng
      Underlying source of randomness.
    • alpha

      protected final double alpha
      The alpha parameter. This is a shape parameter.
    • theta

      protected final double theta
      The theta parameter. This is a scale parameter.
  • Constructor Details

    • BaseGammaSampler

      BaseGammaSampler(UniformRandomProvider rng, double alpha, double theta)
      Parameters:
      rng - Generator of uniformly distributed random numbers.
      alpha - Alpha parameter of the distribution.
      theta - Theta parameter of the distribution.
      Throws:
      IllegalArgumentException - if alpha <= 0 or theta <= 0
    • BaseGammaSampler

      private BaseGammaSampler(double alpha, double theta, UniformRandomProvider rng)
      Parameters:
      alpha - Alpha parameter of the distribution.
      theta - Theta parameter of the distribution.
      rng - Generator of uniformly distributed random numbers.
    • BaseGammaSampler

      Parameters:
      rng - Generator of uniformly distributed random numbers.
      source - Source to copy.
  • Method Details