Class BoxMuller
- java.lang.Object
-
- dev.nm.stat.random.rng.univariate.normal.BoxMuller
-
- All Implemented Interfaces:
RandomStandardNormalGenerator
,RandomNumberGenerator
,Seedable
public class BoxMuller extends Object implements RandomStandardNormalGenerator
The Box-Muller transform (by George Edward Pelham Box and Mervin Edgar Muller 1958) is a pseudo-random number sampling method for generating pairs of independent standard normally distributed (zero expectation, unit variance) random numbers, given a source of uniformly distributed random numbers.- See Also:
- Wikipedia: Box-Muller transform
- "G. E. P. Box, and M. E. Muller, "A note on the generation of random normal deviates," Annals of Mathematical Statistics 29:610-611, 1958."
-
-
Constructor Summary
Constructors Constructor Description BoxMuller()
Construct a random number generator to sample from the standard Normal distribution.BoxMuller(RandomLongGenerator uniform)
Construct a random number generator to sample from the standard Normal distribution.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
nextDouble()
Get the next randomdouble
.void
seed(long... seeds)
Seed the random number/vector/scenario generator to produce repeatable experiments.
-
-
-
Constructor Detail
-
BoxMuller
public BoxMuller(RandomLongGenerator uniform)
Construct a random number generator to sample from the standard Normal distribution.- Parameters:
uniform
- a uniform random number generator
-
BoxMuller
public BoxMuller()
Construct a random number generator to sample from the standard Normal distribution.
-
-
Method Detail
-
seed
public void seed(long... seeds)
Description copied from interface:Seedable
Seed the random number/vector/scenario generator to produce repeatable experiments.
-
nextDouble
public double nextDouble()
Description copied from interface:RandomNumberGenerator
Get the next randomdouble
.- Specified by:
nextDouble
in interfaceRandomNumberGenerator
- Returns:
- the next random number
-
-