Why Does the Marsaglia Polar Method Generate Standard Normals?
At a glance
- 1. Draw two uniforms
Choose U and V independently and uniformly from the interval from minus one to one.
- 2. Keep points in disk
Compute S = U squared plus V squared; reject unless zero is less than S and S is less than one.
- 3. Transform the point
Multiply both coordinates by the square root of minus two times the natural log of S, divided by S.
- 4. Read the outputs
The transformed coordinates are independent standard normal random variables.
The Marsaglia polar method generates normal random variables from uniform ones by rejecting some pairs and transforming the rest. Its key is that accepted points are uniformly distributed in a disk. The point’s angle supplies a uniform direction, while a transformation of its distance from the origin supplies exactly the radial distribution of a two-dimensional standard normal.
The method
Draw and independently and uniformly from , then calculate
If or , reject the pair and draw another. Otherwise, set
The pair consists of two independent standard normal random variables. Some implementations start with uniforms on and convert them using and . The endpoints do not affect the distribution because individual endpoints have probability zero.
Why the accepted point is uniform in the disk
Before rejection, is uniform in the square : its density is constant there. Conditioning on the event restricts this constant density to the unit disk. Thus, given that a pair is accepted, its location is uniform in that disk.
Write the point in polar coordinates as , where . For , the probability that , conditional on acceptance, is the ratio of the area of a disk of radius to the area of the unit disk:
Therefore is uniform on . The angle is uniform on and independent of , because the disk is rotationally symmetric and the density is constant.
The probability of accepting one proposed pair is the ratio of the unit disk’s area to the square’s area:
Rejection changes how many proposals the algorithm needs, but not the conditional distribution of an accepted point.
Why the transformed radius is normal
The transformation multiplies the original point by the positive factor . It leaves its angle unchanged. Since the original radius is , the new radius is
For , the distribution of this radius follows from :
Differentiating gives the radius density for . Together with the independent uniform angle, this is the polar-coordinate distribution of a bivariate standard normal. In polar coordinates its density is
To convert from polar coordinates to Cartesian coordinates, divide by the Jacobian factor . The resulting joint density is
Each factor is the density of a standard normal variable, and the joint density factors into the product of the two marginal densities. That factorization proves both that and are standard normal and that they are independent.
A numerical example
Suppose a proposed pair is and . Then
so the point is accepted. The multiplier is
The output is approximately and . A single output pair does not demonstrate the distribution; the proof comes from the distribution of the accepted radius and angle. This calculation simply shows how an accepted point is transformed.
Common mistakes
- Keeping points outside the disk: Reject when . The proof relies on the accepted points being uniform in the unit disk, not in the whole square.
- Forgetting to reject : The formula divides by and involves . This case has probability zero in exact sampling, but an implementation should reject it.
- Using the wrong multiplier: The factor is . Omitting the division by fails to cancel the original radius .
- Confusing the two coordinates: A single accepted pair produces two independent standard normal values. If you use only one, the other is still a valid normal draw; it is often more efficient to retain both.
- Treating the acceptance rate as a normality condition: The rate measures efficiency, not correctness. Correctness comes from the conditional distribution of accepted points and the radius transformation.
In finite-precision arithmetic, the method is implemented with pseudorandom numbers rather than ideal continuous uniforms. The mathematical result describes the ideal algorithm; practical output accuracy also depends on the quality of the random-number generator and numerical implementation.
References
- G. Marsaglia and T. A. Bray, “A Convenient Method for Generating Normal Variables,” SIAM Review, 6(3), 260–264 (1964).
Spotted an error? Send a correction. Read how we write and check articles in our editorial policy.