2
$\begingroup$

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.

  • 0
    I think you lucked out. After dispensing appropriately with absolute values, you can integrate by substitution.2012-03-26
  • 0
    Not that it matters, but I would prefer saying it is twice the integral from $\mu$ to infinity. Positive is nice.2012-03-26
  • 0
    I agree. That's what I meant by appropriately. See below...2012-03-26

1 Answers 1

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.$$

  • 0
    You want $|x|$, not $x$, in your first integral.2012-03-26