Class MarsagliaBray1964
java.lang.Object
dev.nm.stat.random.rng.univariate.normal.MarsagliaBray1964
- All Implemented Interfaces:
RandomStandardNormalGenerator
,RandomNumberGenerator
,Seedable
The polar method (attributed to George Marsaglia, 1964) is a pseudo-random number sampling method
for generating a pair of independent standard normal random variables.
This is an acceptance-rejection method so there is no upper-bound on the number of uniforms it
may use to generate a sample.
Hence, this method is not applicable to quasi-Monte Carlo simulation.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionConstruct a random number generator to sample from the standard Normal distribution.MarsagliaBray1964
(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
-
MarsagliaBray1964
Construct a random number generator to sample from the standard Normal distribution.- Parameters:
uniform
- a uniform random number generator
-
MarsagliaBray1964
public MarsagliaBray1964()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
-