# Box-Muller Method Proof

Here we want to show that the Box-Muller method generates a pair of independent standard Gaussian random variables. But I don't understand why we use the determinant? For me when you have two independent variables the joint density function is only the product of the two density function. Someone can explain me the meaning of the determinant here? Please. • There is a "change of variables" involved in going from X to Y and therefore you have to multiply by the Jacobian of the transformation which is the determinant that you see above. See for example Proposition 8 here math.uah.edu/stat/dist/Transformations.html – Alex C Aug 29 '16 at 5:22
• Ok I understand thank you Alex for your answer. – A. B Aug 29 '16 at 5:31

Let $Z=\sqrt{-2\ln(X_1)}$, We have

\begin{align} \mathbb{P}\left[Z \leq z\right] = \mathbb{P}\left[-2 \ln(X_1) \leq z^2\right] = \mathbb{P}\left[\ln(X_1) \geq -\frac{z^2}{2}\right] = 1 - \mathbb{P}\biggl[X_1 < \exp\left(-\frac{z^2}{2}\right)\biggr]\, \end{align} $X_1$ is uniformly defined on $[0, 1]$, therefore $$\mathbb{P}[Z\leq z] = 1 - \int_0^{\exp(-z^2/2)} \, dt = 1 - \exp\left(-\frac{z^2}{2}\right).$$ Indeed $$f_Z(z)=\begin{cases} \exp\left(-\frac{z^2}{2}\right),\quad z>0\\ 0\qquad\qquad,\quad \text{o.w} \end{cases}$$ let $W=2\pi X_2$. Hence $X_2$ is uniformly distributed on $[0,1]$, so $$f_W(w)=\begin{cases} \frac{1}{2\pi},\quad 0< w\le 2\pi\\ 0\,\,\,\,, \quad\text{o.w} \end{cases}$$ Since $X_1$ and $X_2$ are independent, $Z$ and $W$ should be independent. We have $$f_{Z,W}(z,w)=f_{Z}(z)f_{W}(w)= \begin{cases} \frac{1}{2\pi}\exp\left(-\frac{z^2}{2}\right),\quad z>0\quad \text{and}\quad 0< w\le 2\pi\\ 0\qquad\qquad\quad\,,\quad \text{o.w} \end{cases}$$ Define function $q:(0,\infty)\times(0,2\pi]\to \mathbb{R}^2$ such that $q(z,w)=(z\cos(w),z\sin(w))$ thus $$\mathbb{P}_{Y_1,Y_2}=\mathbb{P}_{Z,W}\circ q^{-1}$$ in other words $$q_{Y_1,Y_2}(y_1,y_2)=\frac{f_{Z, W}(q^{-1}(y_1, y_2))}{|\det(q'(q^{-1}(y_1, y_2)))|}$$ we can show easily $$z=\sqrt{y_1^2+y_2^2}$$ then $$q_{Y_1,Y_2}(y_1,y_2) = \frac{1}{2 \pi} \exp\left(-\frac{y_1^2 + y_2^2}{2}\right)$$

It can be seen that $$Y_1^2+Y_2^2=-2\log{X_2}$$ and that $$Y_2 \over Y_1$$ $$=\tan(2\pi X_1)$$.

Therefore $$X_1={1 \over{2 \pi}}{\arctan{Y_2 \over Y_1}}$$ and $$X_2=\exp{-(Y_1^2+Y_2^2) \over 2}$$.

Taking differential to get $$dX_1= {1 \over{2\pi}}{{-Y_2dY_1+Y_1dY_2} \over{Y_1^2+Y_2^2}}$$.

Similarly, $$dX_2= {\exp {-{Y_1^2+Y_2^2} \over 2}(Y_1 dY_1 + Y_2dY_2 )}$$.

Hence Jacobian $$\mathbb J({{X_1,X_2} \over {Y_1,Y_2}})$$ =$$1\over {2 \pi}$$ $$\exp{-(Y_1^2+Y_2^2) \over 2}$$.

For PDFs, as $$f_{X_1,X_2}(x_1,x_2)$$ $$\mathbb J({{X_1,X_2} \over {Y_1,Y_2}}) =$$ $$f_{Y_1,Y_2}(y_1,y_2)$$,

it gives $$f_{Y_1,Y_2}(y_1,y_2)=$$ $$\sqrt{1 \over{2 \pi}}$$ $$\exp{-y_1^2 \over 2}$$ $$\sqrt{1 \over{2 \pi}}$$ $$\exp{-y_1^2 \over 2}$$

showing that $$Y_1,Y_2$$ are independent Gaussian random variables.

• range of $X_1$ should be (0,1), but $X_1=\frac{1}{2\pi}\arctan{\frac{Y_2}{Y_1}}$ is $(-\frac{1}{4},\frac{1}{4})$ – WCMC Jan 1 at 23:34