Re: Stochastic Positioning of A Point in A 3D Gaussian Distribution



On 1 Sep 2006 09:56:43 -0700, hoffmann@xxxxxxxxxxxx wrote:
1. Why is the Box-Muller Transform, which converts two PRNG
(pseudo random number generator) numbers u1,u2 with
uniform distributions into a geometrical pair x,y with Gaussian
distributions, better than a transform which converts simply
one PRNG number with uniform distribution into one number
with Gaussian distribution ?
http://en.wikipedia.org/wiki/Box-Muller_transform
The OP needs obviously THREE numbers for x,y,z.

2. Numbers by a PRNG with uniform distribution can be trans-
formed into numbers with Gaussian distribution either by adding
N numbers or by averaging N numbers.
E.g. one can find that N=6 is reasonable and N=12 is near to
perfect.
IMO this is perhaps faster than using Box-Muller.
Is any comparison of quality available ?

There is no reason anyone should need to write their own pseudo-random
number generator, whether for uniform or Gaussian distributions. It's
really easy to create a bad uniform generator, and even the venerable
Box-Muller generator for Gaussians has two major variations, one of
which is troublesome.

Four possibilities are:

* Box-Muller: this gives two independent variates for each call, and
is still fast even if one is discarded.
* Ratio: This is a method using rejection, and the ellipse regions of
Leva make it fast as well as brief.
* Averaging uniform: This is both slow and inaccurate, it is not to
be recommended even with some known adjustments.
* Ziggurat: A variation of the "rectangle-wedge-tail" approach, this
tends to be the fastest, but requires a large table.

Two good sources to consult are Luc Devroye,

<http://cg.scs.carleton.ca/~luc/rng.html>

(including his book, a free download),

<http://cg.scs.carleton.ca/~luc/books-luc.html>

and Knuth,

Knuth, D. The Art of Computer Programming, Vol. II., 3/e.

Or just grab an implementation, such as winrand,

<http://crypto.mat.sbg.ac.at/ftp/pub/data/winrand.zip>

or the GNU Scientific Library (GSL).

<http://www.gnu.org/software/gsl/>
.



Relevant Pages

  • Re: Adding White Noise (Gaussian Noise) To a Set of 3D Points
    ... delivers random values which have approximately a Gaussian ... such a generator delivers a flat spectrum? ... the amplitude distribution and the ... amplitude distribution and a flat spectrum for the signal. ...
    (comp.graphics.algorithms)
  • Re: Gaussian distribution RNGs for RLs?
    ... whose output shows Gaussian distribution instead of the ... standard uniform distribution for things like damage? ... Gaussian distribution means that the results in the ... And I wouldn't expect the damage done by a sword in practice to be ...
    (rec.games.roguelike.development)
  • Re: Random number generators
    ... The average is a property of the distribution, not the generator. ... Fortran standard says nothing about its qualidy, ... uniform distribution. ...
    (comp.lang.fortran)
  • Re: Stochastic Positioning of A Point in A 3D Gaussian Distribution
    ... Why is the Box-Muller Transform, which converts two PRNG ... (pseudo random number generator) ... uniform distributions into a geometrical pair x,y with Gaussian ... Numbers by a PRNG with uniform distribution can be trans- ...
    (comp.graphics.algorithms)
  • Re: issues with statistical test suite from http://csrc.nist.gov/rng/
    ... A distribution, or data set, is symmetric if it looks the ... >> A generator is bad when it fails a test that has a good mathematical ... The most common criteria are lack of correlation and even ... Since some of the best minds in mathematics can't come up with ...
    (sci.crypt)