Variance of Gaussian Distribution

From ProofWiki
Jump to navigation Jump to search

Theorem

Let $X \sim N \paren {\mu, \sigma^2}$ for some $\mu \in \R, \sigma \in \R_{> 0}$, where $N$ is the Gaussian distribution.

Then:

$\var X = \sigma^2$


Proof 1

From the definition of the Gaussian distribution, $X$ has probability density function:

$\map {f_X} x = \dfrac 1 {\sigma \sqrt {2 \pi} } \map \exp {-\dfrac {\paren {x - \mu}^2} {2 \sigma^2} }$

From Variance as Expectation of Square minus Square of Expectation:

$\ds \var X = \int_{-\infty}^\infty x^2 \map {f_X} x \rd x - \paren {\expect X}^2$

So:

\(\ds \var X\) \(=\) \(\ds \frac 1 {\sigma \sqrt {2 \pi} } \int_{-\infty}^\infty x^2 \map \exp {-\frac {\paren {x - \mu}^2} {2 \sigma^2} } \rd x - \mu^2\) Expectation of Gaussian Distribution
\(\ds \) \(=\) \(\ds \frac {\sqrt 2 \sigma} {\sigma \sqrt {2 \pi} } \int_{-\infty}^\infty \paren {\sqrt 2 \sigma t + \mu}^2 \map \exp {-t^2} \rd t - \mu^2\) substituting $t = \dfrac {x - \mu} {\sqrt 2 \sigma}$
\(\ds \) \(=\) \(\ds \frac 1 {\sqrt \pi} \paren {2 \sigma^2 \int_{-\infty}^\infty t^2 \map \exp {-t^2} \rd t + 2 \sqrt 2 \sigma \mu \int_{-\infty}^\infty t \map \exp {-t^2} \rd t + \mu^2 \int_{-\infty}^\infty \map \exp {-t^2} \rd t} - \mu^2\)
\(\ds \) \(=\) \(\ds \frac 1 {\sqrt \pi} \paren {2 \sigma^2 \int_{-\infty}^\infty t^2 \map \exp {-t^2} \rd t + 2 \sqrt 2 \sigma \mu \intlimits {-\frac 1 2 \map \exp {-t^2} } {-\infty} \infty + \mu^2 \sqrt \pi} - \mu^2\) Fundamental Theorem of Calculus, Gaussian Integral
\(\ds \) \(=\) \(\ds \frac 1 {\sqrt \pi} \paren {2 \sigma^2 \int_{-\infty}^\infty t^2 \map \exp {-t^2} \rd t + 2\sqrt 2 \sigma \mu \cdot 0} + \mu^2 - \mu^2\) Exponential Tends to Zero and Infinity
\(\ds \) \(=\) \(\ds \frac {2 \sigma^2} {\sqrt \pi} \int_{-\infty}^\infty t^2 \map \exp {-t^2} \rd t\)
\(\ds \) \(=\) \(\ds \frac {2 \sigma^2} {\sqrt \pi} \paren {\intlimits {-\frac t 2 \map \exp {-t^2} } {-\infty} \infty + \frac 1 2 \int_{-\infty}^\infty \map \exp {-t^2} \rd t}\) Integration by Parts
\(\ds \) \(=\) \(\ds \frac {2 \sigma^2} {\sqrt \pi} \cdot \frac 1 2 \int_{-\infty}^\infty \map \exp {-t^2} \rd t\) Exponential Tends to Zero and Infinity
\(\ds \) \(=\) \(\ds \frac{2 \sigma^2 \sqrt \pi} {2 \sqrt \pi}\) Gaussian Integral
\(\ds \) \(=\) \(\ds \sigma^2\)

$\blacksquare$


Proof 2

By Moment Generating Function of Gaussian Distribution, the moment generating function of $X$ is given by:

$\map {M_X} t = \map \exp {\mu t + \dfrac 1 2 \sigma^2 t^2}$

From Variance as Expectation of Square minus Square of Expectation:

$\var X = \expect {X^2} - \paren {\expect X}^2$


From Moment Generating Function of Gaussian Distribution: Second Moment:

$\map { {M_X}} t = \paren {\sigma^2 + \paren {\mu + \sigma^2 t}^2 } \map \exp {\mu t + \dfrac 1 2 \sigma^2 t^2}$


From Moment in terms of Moment Generating Function, we also have:

$\expect {X^2} = \map { {M_X}} 0$


Setting $t = 0$, we obtain the second moment:

\(\ds \map {M_X} 0\) \(=\) \(\ds \expect {X^2}\)
\(\ds \) \(=\) \(\ds \paren {\sigma^2 + \paren {\mu + \sigma^2 0}^2 } \map \exp {\mu 0 + \dfrac 1 2 \sigma^2 0^2}\)
\(\ds \) \(=\) \(\ds \paren {\sigma^2 + \mu^2 } \exp 0\)
\(\ds \) \(=\) \(\ds \sigma^2 + \mu^2\) Exponential of Zero

So:

\(\ds \var X\) \(=\) \(\ds \sigma^2 + \mu^2 - \paren {\expect X}^2\)
\(\ds \) \(=\) \(\ds \sigma^2 + \mu^2 - \mu^2\) Expectation of Gaussian Distribution
\(\ds \) \(=\) \(\ds \sigma^2\)

$\blacksquare$


Sources