Class ZigguratSampler.Exponential
java.lang.Object
org.apache.commons.rng.sampling.distribution.ZigguratSampler
org.apache.commons.rng.sampling.distribution.ZigguratSampler.Exponential
- All Implemented Interfaces:
ContinuousSampler, SharedStateContinuousSampler, SharedStateSampler<SharedStateContinuousSampler>
- Enclosing class:
ZigguratSampler
Modified ziggurat method for sampling from an exponential distribution.
- Since:
- 1.4
-
Nested Class Summary
Nested classes/interfaces inherited from class ZigguratSampler
ZigguratSampler.Exponential, ZigguratSampler.NormalizedGaussian -
Method Summary
Modifier and TypeMethodDescriptionstatic ZigguratSampler.Exponentialof(UniformRandomProvider rng) Create a new exponential sampler withmean = 1.static ZigguratSampler.Exponentialof(UniformRandomProvider rng, double mean) Create a new exponential sampler with the specifiedmean.doublesample()Creates adoublesample.toString()Create a new instance of the sampler with the same underlying state using the given uniform random provider as the source of randomness.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface ContinuousSampler
samples, samples
-
Method Details
-
toString
-
sample
-
withUniformRandomProvider
Create a new instance of the sampler with the same underlying state using the given uniform random provider as the source of randomness.- Parameters:
rng- Generator of uniformly distributed random numbers.- Returns:
- the sampler
-
of
Create a new exponential sampler withmean = 1.- Parameters:
rng- Generator of uniformly distributed random numbers.- Returns:
- the sampler
-
of
Create a new exponential sampler with the specifiedmean.- Parameters:
rng- Generator of uniformly distributed random numbers.mean- Mean.- Returns:
- the sampler
- Throws:
IllegalArgumentException- if the mean is not strictly positive (mean <= 0)
-