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
    Construct a random number generator to sample from the standard Normal distribution.
    Construct a random number generator to sample from the standard Normal distribution.
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    Get the next random double.
    void
    seed(long... seeds)
    Seed the random number/vector/scenario generator to produce repeatable experiments.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • 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 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