Class ZigguratSampler.NormalizedGaussian
java.lang.Object
org.apache.commons.rng.sampling.distribution.ZigguratSampler
org.apache.commons.rng.sampling.distribution.ZigguratSampler.NormalizedGaussian
- All Implemented Interfaces:
ContinuousSampler, NormalizedGaussianSampler, SharedStateContinuousSampler, SharedStateSampler<SharedStateContinuousSampler>
- Enclosing class:
ZigguratSampler
public static final class ZigguratSampler.NormalizedGaussian
extends ZigguratSampler
implements NormalizedGaussianSampler, SharedStateContinuousSampler
Modified ziggurat method for sampling from a Gaussian distribution with
mean 0 and standard deviation 1.
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.
- Since:
- 1.4
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class ZigguratSampler
ZigguratSampler.Exponential, ZigguratSampler.NormalizedGaussian -
Method Summary
Modifier and TypeMethodDescriptionof(UniformRandomProvider rng) Create a new normalised Gaussian sampler.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
Creates adoublesample.- Specified by:
samplein interfaceContinuousSampler- Returns:
- a 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.- Specified by:
withUniformRandomProviderin interfaceSharedStateSampler<SharedStateContinuousSampler>- Parameters:
rng- Generator of uniformly distributed random numbers.- Returns:
- the sampler
-
of
Create a new normalised Gaussian sampler.- Parameters:
rng- Generator of uniformly distributed random numbers.- Returns:
- the sampler
-