public static final class ZigguratSampler.NormalizedGaussian extends ZigguratSampler implements NormalizedGaussianSampler, SharedStateContinuousSampler
Note: The algorithm is a modification of the
Marsaglia and Tsang "Ziggurat" method
.
The modification improves performance of the rejection method used to generate
samples at the edge of the ziggurat.
NormalizedGaussianSampler
,
GaussianSampler
ZigguratSampler.Exponential, ZigguratSampler.NormalizedGaussian
Modifier and Type | Method and Description |
---|---|
static ZigguratSampler.NormalizedGaussian |
of(UniformRandomProvider rng)
Create a new normalised Gaussian sampler.
|
double |
sample()
Creates a
double sample. |
String |
toString() |
ZigguratSampler.NormalizedGaussian |
withUniformRandomProvider(UniformRandomProvider rng)
Create a new instance of the sampler with the same underlying state using the given
uniform random provider as the source of randomness.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
samples, samples
public double sample()
double
sample.sample
in interface ContinuousSampler
public ZigguratSampler.NormalizedGaussian withUniformRandomProvider(UniformRandomProvider rng)
withUniformRandomProvider
in interface SharedStateSampler<SharedStateContinuousSampler>
rng
- Generator of uniformly distributed random numbers.public static ZigguratSampler.NormalizedGaussian of(UniformRandomProvider rng)
rng
- Generator of uniformly distributed random numbers.Copyright © 2016–2022 The Apache Software Foundation. All rights reserved.