Design Flaws in the Implementation of the Ziggurat and Monty Python methods (and some remarks on Matlab randn)
Boaz Nadler
Abstract
Ziggurat and Monty Python are two fast and elegant methods proposed by Marsaglia and Tsang to transform uniform random variables to random variables with normal, exponential and other common probability distributions. While the proposed methods are theoretically correct, we show that there are various design flaws in the uniform pseudo random number generators (PRNG's) of their published implementations for both the normal and Gamma distributions Ziggurat,Gamma,Monty. These flaws lead to non-uniformity of the resulting pseudo-random numbers and consequently to noticeable deviations of their outputs from the required distributions. In addition, we show that the underlying uniform PRNG of the published implementation of Matlab's randn, which is also based on the Ziggurat method, is not uniformly distributed with correlations between consecutive pairs. Also, we show that the simple linear initialization of the registers in matlab's randn may lead to non-trivial correlations between output sequences initialized with different (related or even random unrelated) seeds. These, in turn, may lead to erroneous results for stochastic simulations.
Create a lesson
Related papers
Compact and Infinite-Order Error Analysis for Null-Space SVD Estimation
Xin Li, Jonathan Cohen, Rami Puzis
Unconditional Finiteness of the Number of Critical Points of Gaussian Mixture Densities
Akifumi Okuno
Bergsma--Dassios Sign Covariance Characterises Independence for Arbitrary Real-Valued Bivariate Laws
Stefan Grünewald, Libo Huang
Cubic-Root Gaussian Approximation under Unrestricted Covariance
Zijun Gao, Weihan Zhang
Distribution-free testing of linear type
Weixuan Xia
Self-normalization for Spectral Density Integrals
Holger Dette, Sebastian Kühnert