Encyclopedia > Box-Muller transform

  Article Content

Box-Muller transform

A Box-Muller transform is a method of generating pairs of independent normally distributed random numbers, given a source of uniformly distributed random numbers. There are two kinds:

  1. Given r and φ independently uniformly distributed in (0,1], compute:
    <math>
    z_0 = \cos(2 \pi \varphi) \cdot \sqrt{-2 \ln r} </math>
    and
    <math>
    z_1 = \sin(2 \pi \varphi) \cdot \sqrt{-2 \ln r} </math>
  2. Given x and y independently uniformly distributed in [-1,1], set r = x2+y2. If r = 0 or r > 1, throw them away and try another pair (x, y). Thus, all points left after this filtering process will be uniformly distributed within a unit circle. Then, for these filtered points, compute:
    <math>
    z_0 = x \cdot \sqrt{\frac{-2 \ln r}{r}} </math>
    and
    <math>
    z_1 = y \cdot \sqrt{\frac{-2 \ln r}{r}} </math>

The second method is faster because it uses only one transcendental function[?] instead of three, even though it throws away 21% of the numbers.

External links



All Wikipedia text is available under the terms of the GNU Free Documentation License

 
  Search Encyclopedia

Search over one million articles, find something about almost anything!
 
 
  
  Featured Article
Islip Terrace, New York

... 1.08% from two or more races. 6.61% of the population are Hispanic or Latino of any race. There are 1,755 households out of which 43.6% have children under the age of 18 ...

 
 
 
This page was created in 27 ms