I want to find $E(|X-\mu|)$ where $X\sim N(\mu,\sigma^2)$. I know this is equal to $2\int_{-\infty}^\mu |x-\mu| \,\,{1\over \sqrt{2\pi}\sigma}\,\exp(-(x-\mu)^2/2\sigma^2)\,dx$ but I am unsure as to how to calculate this integral.
How to integrate the normal distribution
2
$\begingroup$
probability
-
0I agree. That's what I meant by appropriately. See below... – 2012-03-26
1 Answers
3
Hint: start with $Z\sim N(0,1)$, use symmetry and $u=\frac12x^2,~du=x\,dx$: $\def\E{\mathbb{E}} \E\left[|Z|\right] =\frac1{\sqrt{2\pi}}\int_{-\infty}^\infty|x|\,e^{-x^2/2}\,dx =\sqrt{\frac2\pi}\int_0^\infty x\,e^{-x^2/2}\,dx =\sqrt{\frac2\pi}\int_0^\infty e^{-u}\,du =\sqrt{\frac2\pi}$ Thus for $X=\mu +\sigma Z$, $\E\left[|X-\mu|\right] =\sigma\,\E\left[|Z|\right] =\sqrt{\frac2\pi}\,\sigma.$
-
0You want $|x|$, not $x$, in your first integral. – 2012-03-26