The Monty Python method for generating random variables
暂无分享,去创建一个
We suggest an interesting and fast method for generating normal, exponential, t, von Mises, and certain other important random variables used in Monte Carlo studies. The right half of a symmetric density is cut into pieces, then, using simple area-preserving transformations, reassembled into a rectangle from which the x-coordinate—or a linear function of the x-coordinate—of a random point provides the required variate. To illustrate the speed and simplicity of the Monty Python method, we provide a small C program, self-contained, for rapid generation of normal (Gaussian) variables. It is self-contained in the sense that required uniform variates are generated in-line, as pairs of 16-bit integers by means of the remarkable new multiply-with-carry method.
[1] Wai Wan Tsang,et al. Computer generation of random variables , 1982 .
[2] George Marsaglia. The exact-approximation method for generating random variables , 1984 .
[3] L. Devroye. Non-Uniform Random Variate Generation , 1986 .
[4] George Marsaglia,et al. A Fast, Easily Implemented Method for Sampling from Decreasing or Symmetric Unimodal Density Functions , 1984 .
[5] Do Le Minh,et al. Generating gamma variates , 1988, TOMS.