Class BoxMullerNormalizedGaussianSampler
- java.lang.Object
-
- org.apache.commons.rng.sampling.distribution.BoxMullerNormalizedGaussianSampler
-
- All Implemented Interfaces:
ContinuousSampler,NormalizedGaussianSampler
public class BoxMullerNormalizedGaussianSampler extends java.lang.Object implements NormalizedGaussianSampler
Box-Muller algorithm for sampling from Gaussian distribution with mean 0 and standard deviation 1.Sampling uses
UniformRandomProvider.nextDouble().- Since:
- 1.1
-
-
Constructor Summary
Constructors Constructor Description BoxMullerNormalizedGaussianSampler(UniformRandomProvider rng)
-
-
-
Constructor Detail
-
BoxMullerNormalizedGaussianSampler
public BoxMullerNormalizedGaussianSampler(UniformRandomProvider rng)
- Parameters:
rng- Generator of uniformly distributed random numbers.
-
-
Method Detail
-
sample
public double sample()
Creates a sample.- Specified by:
samplein interfaceContinuousSampler- Returns:
- a sample.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-