Class MarsagliaBray1964

java.lang.Object
dev.nm.stat.random.rng.univariate.normal.MarsagliaBray1964
All Implemented Interfaces:
RandomStandardNormalGenerator, RandomNumberGenerator, Seedable

public class MarsagliaBray1964 extends Object implements RandomStandardNormalGenerator
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 Details

    • MarsagliaBray1964

      public MarsagliaBray1964(RandomLongGenerator uniform)
      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.
      Specified by:
      seed in interface Seedable
      Parameters:
      seeds - the seeds
    • nextDouble

      public double nextDouble()
      Description copied from interface: RandomNumberGenerator
      Get the next random double.
      Specified by:
      nextDouble in interface RandomNumberGenerator
      Returns:
      the next random number