Class BoxMuller
java.lang.Object
dev.nm.stat.random.rng.univariate.normal.BoxMuller
- All Implemented Interfaces:
RandomStandardNormalGenerator
,RandomNumberGenerator
,Seedable
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:
-
Constructor Summary
ConstructorsConstructorDescriptionConstruct 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
Modifier and TypeMethodDescriptiondouble
Get the next randomdouble
.void
seed
(long... seeds) Seed the random number/vector/scenario generator to produce repeatable experiments.
-
Constructor Details
-
BoxMuller
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 Details
-
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
-