AhrensDieterMarsagliaTsangGammaSampler

class AhrensDieterMarsagliaTsangGammaSampler : Sampler<Double>

Sampling from the gamma distribution.

  • For 0 < alpha < 1: Ahrens, J. H. and Dieter, U., Computer methods for sampling from gamma, beta, Poisson and binomial distributions, Computing, 12, 223-246, 1974.

  • For alpha >= 1: Marsaglia and Tsang, A Simple Method for Generating Gamma Variables. ACM Transactions on Mathematical Software, Volume 26 Issue 3, September, 2000.

Based on Commons RNG implementation.

See https://commons.apache.org/proper/commons-rng/commons-rng-sampling/apidocs/org/apache/commons/rng/sampling/distribution/AhrensDieterMarsagliaTsangGammaSampler.html.

Types

Companion
Link copied to clipboard
common
object Companion

Functions

sample
Link copied to clipboard
common
open override fun sample(generator: RandomGenerator): Chain<Double>
Generates a chain of samples.
toString
Link copied to clipboard
common
open override fun toString(): String

Sources

common source
Link copied to clipboard