Proving Expected Value in Normal Distribution

normal distribution

This is the general formula for the expected value of a continuous variable:
$${\rm E}\left( X \right) = {1 \over {\sigma \sqrt {2\pi } }}\int_{ – \infty }^\infty {x{e^{ – {{{{(x – \mu )}^2}} \over {2{\sigma ^2}}}}}dx} $$

Going through some personal notes I wrote months ago, in order to prove that $E\left( {\left| {X – \mu } \right|} \right) = \sigma \sqrt {{2 \over \pi }} $ , I took this formula above and plugged in my $\left( {\left| {X – \mu } \right|} \right)$ factor, but only in the $x$ in the numerator, and not in the $x$ that's in the exponential function. Why am I supposed to ignore that other $x$?

$$\eqalign{
& {\rm E}[|X – \mu |] = {1 \over {\sigma \sqrt {2\pi } }}\int_{ – \infty }^\infty {\left| {x – \mu } \right|{e^{ – {{{{(x – \mu )}^2}} \over {2{\sigma ^2}}}}}dx} \cr
& t = {{x – \mu } \over {\sqrt 2 \sigma }},{\rm{ }}dt = {1 \over {\sqrt 2 \sigma }}dx \cr
& {\rm E}[|X – \mu |] = {1 \over {\sqrt 2 \sigma \pi }}\int_{ – \infty }^\infty {2\sigma |t|{e^{{t^2}}}} \sqrt 2 \sigma dt \cr
& {\rm E}[|X – \mu |] = {{2\sigma } \over {\sqrt \pi }}\int_{ – \infty }^\infty {|t|{e^{{t^2}}}} \cr} $$

I asked for help with this full proof last year and now looking at the whole thing again, I don't why the power of the exponential remains untouched in the process.

Best Answer

The expectation of a random variable $X$ on a probability space $(\Omega, \mathcal{F}, P)$ is defined to be the Lebesgue measure with respect to $P$, that is: \begin{eqnarray} \mathbb{E}[X] := \int_{\Omega} X(\omega)dP(\omega) \tag{1}\label{1} \end{eqnarray} Now, there is a famous result in measure theory that states the following. Suppose $\nu$ is a measure in a measurable space $(\Omega, \mathcal{F})$ and define on this space another measure $\mu$ by setting: \begin{eqnarray} \mu(A) := \int_{A}\delta d\nu \quad \mbox{for all $A \in \mathcal{F}$} \tag{2}\label{2} \end{eqnarray} where $\delta: \Omega \to \mathbb{R}$ is nonnegative and measurable (called density of $\mu$ with respect to $\nu$). Then, if $f$ is measurable and nonnegative, the following identity holds: \begin{eqnarray} \int f d\mu = \int f \delta d\nu \tag{3}\label{3} \end{eqnarray} On the other hand, suppose $(\Omega, \mathcal{F})$ and $(\Omega', \mathcal{F}')$ are two measurable spaces, $\mu$ is a measure on $\mathcal{F}$ and $T: \Omega\to\Omega'$ is $\mathcal{F}/\mathcal{F}'$-measurable. We can define a measure $\mu T^{-1}$ on $\mathcal{F}'$ by setting: \begin{eqnarray} \mu T^{-1}(A') := \mu(T^{-1}(A')) \quad \mbox{for every $A' \in \mathcal{F}'$} \tag{4}\label{4} \end{eqnarray} In this case, if $f:\Omega'\to \mathbb{R}$ is nonegative and $\mathcal{F}'$-measurable you have the change of variable formula: \begin{eqnarray} \int_{\Omega}(f\circ T)(\omega) d\mu(\omega) = \int_{\Omega'}f(\omega')d\mu T^{-1}(\omega') \tag{5}\label{5} \end{eqnarray}

Let's put it all together. Going back to our initial random variable $X$, let $g: \mathbb{R}\to\mathbb{R}$ be measurable. Then, if $g(X) = g\circ X$ we have: \begin{eqnarray} \mathbb{E}[g(X)] = \int_{\Omega'}(g\circ X)(\omega)dP(\omega) \tag{6}\label{6} \end{eqnarray} If, in addition, $X$ is distributed by a nondegenerate Gaussian measure $\mu$, then $\mu$ satisfies: \begin{eqnarray} \mu(A) = PX^{-1}(A) = \int_{A}\frac{1}{\sqrt{2\pi}\sigma}e^{-\frac{(x-\mu)^{2}}{2\sigma^{2}}}d\lambda(x) \tag{7}\label{7} \end{eqnarray} where $\lambda$ denotes the Lebesgue measure on $\mathbb{R}$. Now, (\ref{7}) is nothing more than conditions (\ref{4}) (with $T = X$ and $\Omega'=\mathbb{R}$) together with condition (\ref{2}) (with $\delta$ being the density of the Gaussian measure and $\nu=\lambda$). Thus, using (\ref{6}). (\ref{5}) and (\ref{3}) we get: \begin{eqnarray} \mathbb{E}[g(X)] = \int g(x)d\mu(x) = \frac{1}{\sqrt{2\pi}\sigma}\int g(x)e^{-\frac{(x-\mu)^{2}}{2\sigma^{2}}}d\lambda(x) \tag{8}\label{8} \end{eqnarray} Your question is answered by taking $g(x) = x-\mu$.

Related Question