Variance of |X-Y| for X and Y ~ N(0,1/2)

778 Views Asked by At

I know $X$ and $Y\sim\mathcal{N}(0,\frac12)$, $X$ and $Y$ are independent. I try the following way to solve variance of $g(X,Y)=|X-Y|$ ,which is $V(|X-Y|)$. If $X>Y$,$V(|X-Y|)=V(X-Y)=V(X)+V(Y)=\frac12+\frac12=1$ (If $X<Y$, $V(|X-Y|)$ is also 1) Hence,$V(|X-Y|)=1$. What's wrong with the answer of my first method (which seems concise and easy to calculate)?

2

There are 2 best solutions below

4
On BEST ANSWER

Note that $-Y$ is also $N\left(0,\frac12\right)$. Thus, $X-Y$ is the sum of two $N\left(0,\frac12\right)$ variables, which is a $N(0,1)$ variable.

The absolute value of a $N(0,1)$ variable has the PDF $$ \sqrt{\frac2\pi}e^{-x^2/2}[x\ge0] $$ where $[\cdot]$ are Iverson Brackets.

Using the substitution $t=x^2/2$, we get $$ \begin{align} \sqrt{\frac2\pi}\int_0^\infty xe^{-x^2/2}\,\mathrm{d}x &=\sqrt{\frac2\pi}\int_0^\infty e^{-t}\,\mathrm{d}t\\ &=\sqrt{\frac2\pi} \end{align} $$ and integrating by parts $$ \begin{align} \sqrt{\frac2\pi}\int_0^\infty x^2e^{-x^2/2}\,\mathrm{d}x &=-\sqrt{\frac2\pi}\int_0^\infty x\,\mathrm{d}e^{-x^2/2}\\ &=\sqrt{\frac2\pi}\int_0^\infty e^{-x^2/2}\,\mathrm{d}x\\[6pt] &=1 \end{align} $$ So the variance is the mean of the square minus the square of the mean: $$ 1-\frac2\pi=\frac{\pi-2}\pi $$

5
On

As $X$ and $Y$ are independant, $X-Y\sim\mathcal{N}(0,1)$, so $V(|X-Y|)=V(|Z|)$ where $Z\sim\mathcal{N}(0,1)$.

$V(|Z|) = E(|Z|^2)-E(|Z|)^2 = E(Z^2)-E(|Z|)^2$.

$E(Z^2)=V(Z)=1$. Now all you have to do is finding $E(|Z|)$ where $Z\sim\mathcal{N}(0,1)$ (calculate the corresponding integral for example).