Box–Muller transform

Generating standard normal distributed random numbers

This method initially be two independent standard random numbers and needs. These can be, for example, generate a random number generator. Standard random numbers are subject to a rectangular distribution with parameters and.

It can be shown that after the following transformation step, it receives two normally distributed ( stochastically ) independent random numbers:

And

If we write the pair with polar coordinates, ie

Then:

Application of the inversion method to transform and in the polar coordinates, and shows that a rectangular distribution with the parameters and subject and an exponential distribution with parameter. From this result, the joint distribution can be derived from and. It is based on the relationship:

The previous transformation steps generate two normally distributed random numbers. A standard normal distribution is a special case of the normal distribution, namely, with the expected value and the variance.

Transform. In the above notation is as usual for the circuit number of the sine, cosine, and the for the natural logarithm.

Problems

Is used to generate the a linear congruential, the pairs lying on a curve described by a spiral. This behavior is closely related to the one described in the set of Marsaglia hyperplane behavior of linear congruential generators.

This problem can be avoided if, instead of the linear congruential an inverse congruence or the polar method.

Conclusion

The Box-Muller method first generates two stochastically independent and normally distributed random numbers, which then can be transformed with any parameters in a normal distribution. The Box-Muller method requires the evaluation of logarithms and trigonometric functions, which can be very time consuming on some machines.

Alternatives

Other ways to generate normally distributed random numbers are described in Article normal distribution. An alternative is e.g. the polar method.

Sources and footnotes

141330
de