Re: Stochastic Positioning of A Point in A 3D Gaussian Distribution
- From: Just d' FAQs <nobody-here@xxxxxxx>
- Date: Sat, 02 Sep 2006 20:02:36 -0500
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/>
.
- References:
- Prev by Date: Re: Binary Image Contour
- Next by Date: ray tracing and texture filtering
- Previous by thread: Re: Stochastic Positioning of A Point in A 3D Gaussian Distribution
- Next by thread: Re: Stochastic Positioning of A Point in A 3D Gaussian Distribution
- Index(es):
Relevant Pages
|