Marsaglia polar method
From Wikipedia, the free encyclopedia
The Marsaglia polar method[1] is a pseudo-random number sampling method for generating a pair of independent standard normal random variables.[2]
Standard normal random variables are frequently used in computer science, computational statistics, and in particular, in applications of the Monte Carlo method.
The polar method works by choosing random points (x, y) in the square −1 < x < 1, −1 < y < 1 until
and then returning the required pair of normal random variables as
or, equivalently,
where and represent the cosine and sine of the angle that the vector (x, y) makes with x axis.
The underlying theory may be summarized as follows:
If u is uniformly distributed in the interval 0 ≤ u < 1, then the point (cos(2πu), sin(2πu)) is uniformly distributed on the unit circumference x2 + y2 = 1, and multiplying that point by an independent random variable ρ whose distribution is
will produce a point
whose coordinates are jointly distributed as two independent standard normal random variables.
History
This idea dates back to Laplace, whom Gauss credits with finding the above
by taking the square root of
The transformation to polar coordinates makes evident that θ is uniformly distributed (constant density) from 0 to 2π, and that the radial distance r has density
(r2 has the appropriate chi square distribution.)
This method of producing a pair of independent standard normal variates by radially projecting a random point on the unit circumference to a distance given by the square root of a chi-square-2 variate is called the polar method for generating a pair of normal random variables,