Class Ziggurat2000

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

public class Ziggurat2000 extends Object implements RandomStandardNormalGenerator
The Ziggurat algorithm is an algorithm for pseudo-random number sampling from the Normal distribution. This is considerably faster than the two more commonly used methods to generate normally distributed random numbers, the Marsaglia polar method or the Box-Muller transform, which require at least a logarithm and a square root. Empirically, however, the Marsaglia polar method and the BoxMuller transform seem to have better distributional properties. There are implementation problems in the original uniform random number generator proposed in the paper. To improve the quality, we use MWC8222 for the uniform random number generation.
See Also:
  • Constructor Details

    • Ziggurat2000

      public Ziggurat2000(RandomLongGenerator uniform)
      Construct a Ziggurat random normal generator.
      Parameters:
      uniform - a uniform random number generator
    • Ziggurat2000

      public Ziggurat2000()
      Construct a Ziggurat random normal generator.
  • 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