Package org.apache.commons.rng.sampling.distribution
This package contains classes for sampling from statistical distributions.
As of version 1.0, the code for specific distributions was adapted from
the corresponding classes in the development version of "Commons Math" (in
package org.apache.commons.math4.distribution
).
When no specific algorithm is provided, one can still sample from any distribution, using the inverse method, as illustrated in:
Algorithms are described in e.g. Luc Devroye (1986), chapter 9 and chapter 10. This paper discusses Gaussian generators.
-
Interface Summary Interface Description ContinuousInverseCumulativeProbabilityFunction Interface for a continuous distribution that can be sampled using the inversion method.ContinuousSampler Sampler that generates values of typedouble
.DiscreteInverseCumulativeProbabilityFunction Interface for a discrete distribution that can be sampled using the inversion method.DiscreteSampler Sampler that generates values of typeint
.LongSampler Sampler that generates values of typelong
.NormalizedGaussianSampler Marker interface for a sampler that generates values from an N(0,1) Gaussian distribution.SharedStateContinuousSampler Sampler that generates values of typedouble
and can create new instances to sample from the same state with a given source of randomness.SharedStateDiscreteSampler Sampler that generates values of typeint
and can create new instances to sample from the same state with a given source of randomness.SharedStateLongSampler Sampler that generates values of typelong
and can create new instances to sample from the same state with a given source of randomness. -
Class Summary Class Description AhrensDieterExponentialSampler Sampling from an exponential distribution.AhrensDieterMarsagliaTsangGammaSampler Sampling from the gamma distribution.AhrensDieterMarsagliaTsangGammaSampler.AhrensDieterGammaSampler Class to sample from the Gamma distribution when0 < alpha < 1
.AhrensDieterMarsagliaTsangGammaSampler.BaseGammaSampler Base class for a sampler from the Gamma distribution.AhrensDieterMarsagliaTsangGammaSampler.MarsagliaTsangGammaSampler Class to sample from the Gamma distribution when thealpha >= 1
.AliasMethodDiscreteSampler Distribution sampler that uses the Alias method.AliasMethodDiscreteSampler.SmallTableAliasMethodDiscreteSampler Sample from the computed tables exploiting the small power-of-two table size.BoxMullerGaussianSampler Deprecated. Since version 1.1.BoxMullerLogNormalSampler Deprecated. Since version 1.1.BoxMullerNormalizedGaussianSampler Box-Muller algorithm for sampling from Gaussian distribution with mean 0 and standard deviation 1.ChengBetaSampler Sampling from a beta distribution.ChengBetaSampler.BaseChengBetaSampler Base class to implement Cheng's algorithms for the beta distribution.ChengBetaSampler.ChengBBBetaSampler Computes one sample using Cheng's BB algorithm, when beta distributionalpha
andbeta
shape parameters are both larger than 1.ChengBetaSampler.ChengBCBetaSampler Computes one sample using Cheng's BC algorithm, when at least one of beta distributionalpha
orbeta
shape parameters is smaller than 1.ContinuousUniformSampler Sampling from a uniform distribution.ContinuousUniformSampler.OpenIntervalContinuousUniformSampler Specialization to sample from an open interval(lo, hi)
.DirichletSampler Sampling from a Dirichlet distribution.DirichletSampler.GeneralDirichletSampler Sample from a Dirichlet distribution with different concentration parameters for each category.DirichletSampler.SymmetricDirichletSampler Sample from a symmetric Dirichlet distribution with the same concentration parameter for each category.DiscreteUniformSampler Discrete uniform distribution sampler.DiscreteUniformSampler.AbstractDiscreteUniformSampler Base class for a sampler from a discrete uniform distribution.DiscreteUniformSampler.FixedDiscreteUniformSampler Discrete uniform distribution sampler when the sample value is fixed.DiscreteUniformSampler.LargeRangeDiscreteUniformSampler Discrete uniform distribution sampler when the range between lower and upper is too large to fit in a positive integer.DiscreteUniformSampler.OffsetDiscreteUniformSampler Adds an offset to an underlying discrete sampler.DiscreteUniformSampler.PowerOf2RangeDiscreteUniformSampler Discrete uniform distribution sampler when the range is a power of 2 and greater than 1.DiscreteUniformSampler.SmallRangeDiscreteUniformSampler Discrete uniform distribution sampler when the range is small enough to fit in a positive integer.FastLoadedDiceRollerDiscreteSampler Distribution sampler that uses the Fast Loaded Dice Roller (FLDR).FastLoadedDiceRollerDiscreteSampler.FixedValueDiscreteSampler Class to handle the edge case of observations in only one category.FastLoadedDiceRollerDiscreteSampler.FLDRSampler Class to implement the FLDR sample algorithm.GaussianSampler Sampling from a Gaussian distribution with given mean and standard deviation.GeometricSampler Sampling from a geometric distribution.GeometricSampler.GeometricExponentialSampler Sample from the geometric distribution by using a related exponential distribution.GeometricSampler.GeometricP1Sampler Sample from the geometric distribution when the probability of success is 1.GuideTableDiscreteSampler Compute a sample fromn
values each with an associated probability.InternalGamma Adapted and stripped down copy of class"org.apache.commons.math4.special.Gamma"
.InternalUtils Functions used by some of the samplers.InternalUtils.FactorialLog Class for computing the natural logarithm of the factorial ofn
.InverseTransformContinuousSampler Distribution sampler that uses the inversion method.InverseTransformDiscreteSampler Distribution sampler that uses the inversion method.InverseTransformParetoSampler Sampling from a Pareto distribution.KempSmallMeanPoissonSampler Sampler for the Poisson distribution.LargeMeanPoissonSampler Sampler for the Poisson distribution.LargeMeanPoissonSampler.LargeMeanPoissonSamplerState Encapsulate the state of the sampler.LevySampler Sampling from a Lévy distribution.LogNormalSampler Sampling from a log-normal distribution.MarsagliaNormalizedGaussianSampler Marsaglia polar method for sampling from a Gaussian distribution with mean 0 and standard deviation 1.MarsagliaTsangWangDiscreteSampler Sampler for a discrete distribution using an optimised look-up table.MarsagliaTsangWangDiscreteSampler.AbstractMarsagliaTsangWangDiscreteSampler The base class for Marsaglia-Tsang-Wang samplers.MarsagliaTsangWangDiscreteSampler.Binomial Create a sampler for the Binomial distribution.MarsagliaTsangWangDiscreteSampler.Binomial.MarsagliaTsangWangFixedResultBinomialSampler Return a fixed result for the Binomial distribution.MarsagliaTsangWangDiscreteSampler.Binomial.MarsagliaTsangWangInversionBinomialSampler Return an inversion result for the Binomial distribution.MarsagliaTsangWangDiscreteSampler.Enumerated Create a sampler for an enumerated distribution ofn
values each with an associated probability.MarsagliaTsangWangDiscreteSampler.MarsagliaTsangWangBase64Int16DiscreteSampler An implementation for the sample algorithm based on the decomposition of the index in the range[0,2^30)
into 5 base-64 digits with 16-bit backing storage.MarsagliaTsangWangDiscreteSampler.MarsagliaTsangWangBase64Int32DiscreteSampler An implementation for the sample algorithm based on the decomposition of the index in the range[0,2^30)
into 5 base-64 digits with 32-bit backing storage.MarsagliaTsangWangDiscreteSampler.MarsagliaTsangWangBase64Int8DiscreteSampler An implementation for the sample algorithm based on the decomposition of the index in the range[0,2^30)
into 5 base-64 digits with 8-bit backing storage.MarsagliaTsangWangDiscreteSampler.Poisson Create a sampler for the Poisson distribution.PoissonSampler Sampler for the Poisson distribution.PoissonSamplerCache Create a sampler for the Poisson distribution using a cache to minimise construction cost.RejectionInversionZipfSampler Implementation of the Zipf distribution.RejectionInversionZipfSampler.RejectionInversionZipfSamplerImpl Implements the rejection-inversion method for the Zipf distribution.SamplerBase Deprecated. Since version 1.1.SmallMeanPoissonSampler Sampler for the Poisson distribution.StableSampler Samples from a stable distribution.StableSampler.Alpha1CMSStableSampler Implement the stable distribution case:alpha == 1
andbeta != 0
.StableSampler.BaseStableSampler Base class for implementations of a stable distribution that requires an exponential random deviate.StableSampler.Beta0CMSStableSampler Implement the generic stable distribution case:alpha < 2
andbeta == 0
.StableSampler.Beta0WeronStableSampler Implement the generic stable distribution case:alpha < 2
andbeta == 0
.StableSampler.CauchyStableSampler Implement thealpha = 1
andbeta = 0
stable distribution case (Cauchy distribution).StableSampler.CMSStableSampler Implement the generic stable distribution case:alpha < 2
andbeta != 0
.StableSampler.GaussianStableSampler Implement thealpha = 2
stable distribution case (Gaussian distribution).StableSampler.LevyStableSampler Implement thealpha = 0.5
andbeta = 1
stable distribution case (Levy distribution).StableSampler.SpecialMath Implement special math functions required by the CMS algorithm.StableSampler.TransformedStableSampler Class for implementations of a stable distribution transformed by scale and location.StableSampler.WeronStableSampler Implement the generic stable distribution case:alpha < 2
andbeta != 0
.TSampler Sampling from a T distribution.TSampler.NormalTSampler Sample from a t-distribution using a normal distribution.TSampler.StudentsTSampler Sample from a t-distribution using Bailey's algorithm.UniformLongSampler Discrete uniform distribution sampler generating values of typelong
.UniformLongSampler.FixedUniformLongSampler Discrete uniform distribution sampler when the sample value is fixed.UniformLongSampler.LargeRangeUniformLongSampler Discrete uniform distribution sampler when the range between lower and upper is too large to fit in a positive long.UniformLongSampler.OffsetUniformLongSampler Adds an offset to an underlying discrete sampler.UniformLongSampler.PowerOf2RangeUniformLongSampler Discrete uniform distribution sampler when the range is a power of 2 and greater than 1.UniformLongSampler.SmallRangeUniformLongSampler Discrete uniform distribution sampler when the range is small enough to fit in a positive long.ZigguratNormalizedGaussianSampler Marsaglia and Tsang "Ziggurat" method for sampling from a Gaussian distribution with mean 0 and standard deviation 1.ZigguratSampler Modified ziggurat method for sampling from Gaussian and exponential distributions.ZigguratSampler.Exponential Modified ziggurat method for sampling from an exponential distribution.ZigguratSampler.Exponential.ExponentialMean Specialisation which multiplies the standard exponential result by a specified mean.ZigguratSampler.NormalizedGaussian Modified ziggurat method for sampling from a Gaussian distribution with mean 0 and standard deviation 1.