Math 2.0

Numerical analysis Monte Carlo and quasi-Monte Carlo methods Theorem

Box–Muller transform

Builds on Continuous uniform distributionNormal distributionIndependence of random variablesPolar coordinatesChange of variables in multiple integralsExponential distribution

Statement

Let U1U_1 and U2U_2 be independent random variables, each with the uniform distribution on (0,1)(0, 1). Let Z1=−2ln⁡U1 cos⁡(2πU2),Z2=−2ln⁡U1 sin⁡(2πU2).Z_1 = \sqrt{-2 \ln U_1}\, \cos(2\pi U_2), \qquad Z_2 = \sqrt{-2 \ln U_1}\, \sin(2\pi U_2). Then Z1Z_1 and Z2Z_2 are independent, and each has the standard normal distribution, with mean 00 and variance 11.

Remarks

Let R=−2ln⁡U1R = \sqrt{-2 \ln U_1} and Θ=2πU2\Theta = 2\pi U_2, so that (Z1,Z2)(Z_1, Z_2) has polar coordinates (R,Θ)(R, \Theta). For t≥0t \ge 0, P(R2>t)=P(U1<e−t/2)=e−t/2P(R^2 > t) = P(U_1 < e^{-t/2}) = e^{-t/2}, so R2R^2 has the exponential distribution with mean 22, and RR has density re−r2/2r e^{-r^2/2} on (0,∞)(0, \infty). Also Θ\Theta is uniform on (0,2π)(0, 2\pi) and independent of RR. By the change of variables formula with Jacobian rr, the pair (Z1,Z2)(Z_1, Z_2) has density 12πe−r2/2=12πe−z12/2⋅12πe−z22/2\frac{1}{2\pi} e^{-r^2/2} = \frac{1}{\sqrt{2\pi}} e^{-z_1^2/2} \cdot \frac{1}{\sqrt{2\pi}} e^{-z_2^2/2}, which is the product of two standard normal densities. Example: U1=e−2U_1 = e^{-2} and U2=1/8U_2 = 1/8 give R=2R = 2, Θ=π/4\Theta = \pi/4, and (Z1,Z2)=(2,2)(Z_1, Z_2) = (\sqrt{2}, \sqrt{2}). Independence of U1U_1 and U2U_2 is necessary: with U2=U1U_2 = U_1 the point (Z1,Z2)(Z_1, Z_2) lies on one curve in the plane, so the pair is not a standard normal pair. To obtain a normal variable with mean μ\mu and standard deviation ss, use μ+sZ1\mu + s Z_1.

Going deeper

For a student

One cannot invert the normal distribution function in closed form, so plain inverse transform sampling does not give normal variables cheaply; going to two dimensions and polar coordinates solves this. Marsaglia's polar method avoids the sine and cosine by sampling a uniform point in the unit disc by rejection and rescaling it. In floating point, U1U_1 must avoid 00, and the tail of Z1Z_1 is truncated by the smallest representable U1U_1. For speed, many libraries now prefer the ziggurat algorithm, which uses mostly one multiplication and one comparison per sample.

Reading path

To understand this page from the ground up, read these 28 pages in order. The foundations come first.

Show the path as a graph
Continuous uniform distribution, concept, no evidence levelContinuous uniform di…conceptEuclidean space, object, no evidence levelEuclidean spaceobjectExponential distribution, concept, no evidence levelExponential distribut…conceptFunction, concept, no evidence levelFunctionconceptFunction composition, concept, no evidence levelFunction compositionconceptIndependence of random variables, concept, no evidence levelIndependence of rando…conceptNormal distribution, concept, no evidence levelNormal distributionconceptFréchet derivative, definition, no evidence levelFréchet derivativedefinitionPolar coordinates, concept, no evidence levelPolar coordinatesconceptFunction of several variables, concept, no evidence levelFunction of several v…conceptLimit of a function of several variables, concept, no evidence levelLimit of a function o…conceptPartial derivative, concept, no evidence levelPartial derivativeconceptContinuity in R^n, definition, no evidence levelContinuity in R^ndefinitionDifferentiable function of several variables, definition, no evidence levelDifferentiable functi…definitionPartial derivative, definition, no evidence levelPartial derivativedefinitionDifferentiable on an open set, definition, no evidence levelDifferentiable on an …definitionDouble integral, definition, no evidence levelDouble integraldefinitionJacobian matrix, definition, no evidence levelJacobian matrixdefinitionChain rule in several variables, statement, no evidence levelChain rule in several…statementHigher partial derivatives, definition, no evidence levelHigher partial deriva…definitionIterated derivative, definition, no evidence levelIterated derivativedefinitionJacobian determinant, definition, no evidence levelJacobian determinantdefinitionDerivative of the inverse function, statement, no evidence levelDerivative of the inv…statementC^k function characterised by continuous derivatives, statement, no evidence levelC^k function characte…statementInverse function theorem, statement, no evidence levelInverse function theo…statementDiffeomorphism, definition, no evidence levelDiffeomorphismdefinitionChange of variables in multiple integrals, statement, no evidence levelChange of variables i…statementBox–Muller transform, statement, no evidence levelBox–Muller transformstatement
Each page uses the pages above it. The colour of the bar on a box shows how strong the evidence is, and the box also gives it as text. The list has the same pages.
  • no evidence level
  1. Continuous uniform distribution concept
  2. Euclidean space object
  3. Exponential distribution concept
  4. Function concept
  5. Function composition concept
  6. Independence of random variables concept
  7. Normal distribution concept
  8. Fréchet derivative definition
  9. Polar coordinates concept
  10. Function of several variables concept
  11. Limit of a function of several variables concept
  12. Partial derivative concept
  13. Continuity in R^n definition
  14. Differentiable function of several variables definition
  15. Partial derivative definition
  16. Differentiable on an open set definition
  17. Double integral definition
  18. Jacobian matrix definition
  19. Chain rule in several variables statement
  20. Higher partial derivatives definition
  21. Iterated derivative definition
  22. Jacobian determinant definition
  23. Derivative of the inverse function statement
  24. C^k function characterised by continuous derivatives statement
  25. Inverse function theorem statement
  26. Diffeomorphism definition
  27. Change of variables in multiple integrals statement
  28. Box–Muller transform statement

Further reading

  1. Web https://en.wikipedia.org/wiki/Box–Muller_transform
About this page
Tag8G07Q9SVQ4
URIm2://8G07Q9SVQ4
Kindstatement, theorem
WritingW0 stub
MSC65C10, 60E05
StatusThis copy of the site has no build data. Run m2 status 8G07Q9SVQ4.
AboutNormal distribution
UsesContinuous uniform distribution, Normal distribution, Independence of random variables, Polar coordinates, Change of variables in multiple integrals, Exponential distribution
Same as

Markdown · JSON · Edit on GitHub

What this page needs for W1

  • a source with a locator (0 of 1)

The writing levels say how complete the text of a page is. They do not measure its truth.

What links here

No page links to this page yet.