Variance of the standard normal distribution.

679 Views Asked by At

Suppose $X \sim N(0,1)$. Find $\mathrm{E}(X)$ and $\mathrm {Var} (X)$.

I have found $E(X)=0$. It's easy. While calculating variance of $X$ I got $2$ where as the actual answer should be $1$. Here's how I proceed $:$

$$\begin{align*} \mathrm{Var} (X) &= \frac 1 {\sqrt {2\pi}} \int_{-\infty}^{\infty} x^2 e^{-{\frac {x^2} 2}}\ dx \\ &= \sqrt {\frac 2 {\pi}} \int_{0}^{\infty} x^2 e^{-{\frac {x^2} 2}}\ dx \\ \end{align*}$$ Now taking the substitution $\frac {x^2} 2 = y$ I found that
$$\begin{align*} \int_{0}^{\infty} x^2 e^{-{\frac {x^2} 2}}\ dx &= \sqrt {2} \int_{0}^{\infty} e^{-y} y^{\frac 1 2}\ dy \\ &= \sqrt {2}\ \Gamma \left ({\frac 3 2} \right) \\ &= \sqrt {\frac {\pi} 2} \\ \end{align*}$$

So $$\begin{align*} \mathrm {Var} (X) &= \sqrt {\frac 2 {\pi}}.\sqrt {\frac {\pi} 2} \\ &= 1 \\ \end{align*}$$

Please check my calculation? Thank you very much.

2

There are 2 best solutions below

2
On BEST ANSWER

It should be $\Gamma(3/2)$, not $\Gamma(1/2)$. Note that $$\Gamma(t) = \int_0^\infty e^{-y} y^{t-1}\; dy$$

EDIT: Now it's right.

0
On

$$E(X^2) = \frac{1}{\sqrt{2\pi}}\int\limits_{-\infty}^{\infty} x^2 e^{-\frac{x^2}{2}} \ dx=\frac{\sqrt{2}}{\sqrt{\pi}}\int\limits_{0}^{\infty} x^2 e^{-\frac{x^2}{2}} \ dx$$ Use integration by parts \begin{equation} \int fg' = fg - \int f'g \end{equation} By taking $f = x$ and $g' = xe^{-\frac{x^2}{2}}$ we get $f' = 1$ and $g = -e^{-\frac{x^2}{2}}$, i.e. \begin{equation} \int\limits_{0}^{\infty} x^2 e^{-\frac{x^2}{2}} \ dx =-x\mathrm{e}^{-\frac{x^2}{2}}-{\displaystyle\int}-\mathrm{e}^{-\frac{x^2}{2}}\,\mathrm{d}x \end{equation} Use $u = \frac{x}{\sqrt{2}}$ \begin{equation} \int\limits_{0}^{\infty} x^2 e^{-\frac{x^2}{2}} \ dx =-x\mathrm{e}^{-\frac{x^2}{2}}+ \frac{\sqrt{\pi}}{\sqrt{2s}} \underbrace{{} {}{\displaystyle\int}\dfrac{2\mathrm{e}^{-u^2}}{\sqrt{{\pi}}}\,\mathrm{d}u}_{\operatorname{erf}(u)} \end{equation} Using $u = \frac{x}{\sqrt{2}}$ we get \begin{equation} \int\limits_{0}^{\infty} x^2 e^{-\frac{x^2}{2}} \ dx =\dfrac{\sqrt{{\pi}}\operatorname{erf}\left(\frac{x}{\sqrt{2}}\right)}{\sqrt{2}}-x\mathrm{e}^{-\frac{x^2}{2}} \end{equation} So \begin{equation} E(X^2) = \frac{\sqrt{2}}{\sqrt{\pi}}\Big(\dfrac{\sqrt{{\pi}}\operatorname{erf}\left(\frac{x}{\sqrt{2}}\right)}{\sqrt{2}}-x\mathrm{e}^{-\frac{x^2}{2}}\Big) = \operatorname{erf}\left(\frac{x}{\sqrt{2}}\right) + \Gamma(x) \Big\vert_0^{\infty} \end{equation} where $\Gamma(x) = K x\mathrm{e}^{-\frac{x^2}{2}}$ goes to zero at $x = 0$ and $+\infty$. So \begin{equation} E(X^2) = \operatorname{erf}\left(\frac{x}{\sqrt{2}}\right)\Big\vert_0^{\infty} = 1 - 0 =1 \end{equation} So \begin{equation} Var(X) = E(X^2) - [E(X)]^2 = 1 - 0 = 1 \end{equation}