Solveeit Logo

Question

Question: How do you derive the variance of a gaussian distribution?...

How do you derive the variance of a gaussian distribution?

Explanation

Solution

The probability density function of a gaussian distribution is 1σ2πe12(xασ)2\dfrac{1}{\sigma \sqrt{2\pi }}{{e}^{-\dfrac{1}{2}{{\left( \dfrac{x-\alpha }{\sigma } \right)}^{2}}}} where α\alpha is the means of distribution and σ\sigma is the variance of standard deviation of distribution. So σ2{{\sigma }^{2}} is the variance of distribution. If f(x) is the probability density function of any distribution, the mean of the distribution is equal to xf(x)dx\int\limits_{-\infty }^{\infty }{xf\left( x \right)dx} and x2f(x)dx(xf(x)dx)2\int\limits_{-\infty }^{\infty }{{{x}^{2}}f\left( x \right)dx}-{{\left( \int\limits_{-\infty }^{\infty }{xf\left( x \right)dx} \right)}^{2}} so variance is equal to x2f(x)dxα2\int\limits_{-\infty }^{\infty }{{{x}^{2}}f\left( x \right)dx}-{{\alpha }^{2}}

Complete step by step solution:
We have to derive variance of normal distribution 1σ2πe12(xασ)2\dfrac{1}{\sigma \sqrt{2\pi }}{{e}^{-\dfrac{1}{2}{{\left( \dfrac{x-\alpha }{\sigma } \right)}^{2}}}}
Variance of the distribution = x21σ2πe12(xασ)2dxα2\int\limits_{-\infty }^{\infty }{{{x}^{2}}\dfrac{1}{\sigma \sqrt{2\pi }}{{e}^{-\dfrac{1}{2}{{\left( \dfrac{x-\alpha }{\sigma } \right)}^{2}}}}}dx-{{\alpha }^{2}}
If we put xασ=t\dfrac{x-\alpha }{\sigma }=t we get x equal to α+tσ\alpha +t\sigma and the limit of t is -\infty to \infty and dx=σdtdx=\sigma dt
x21σ2πe12(xασ)2dxα2=(α+tσ)212πe12t2dtα2\Rightarrow \int\limits_{-\infty }^{\infty }{{{x}^{2}}\dfrac{1}{\sigma \sqrt{2\pi }}{{e}^{-\dfrac{1}{2}{{\left( \dfrac{x-\alpha }{\sigma } \right)}^{2}}}}}dx-{{\alpha }^{2}}=\int\limits_{-\infty }^{\infty }{{{\left( \alpha +t\sigma \right)}^{2}}}\dfrac{1}{\sqrt{2\pi }}{{e}^{-\dfrac{1}{2}{{t}^{2}}}}dt-{{\alpha }^{2}}
x21σ2πe12(xασ)2dxα2=(α2+t2σ2+2tασ)12πe12t2dtα2\Rightarrow \int\limits_{-\infty }^{\infty }{{{x}^{2}}\dfrac{1}{\sigma \sqrt{2\pi }}{{e}^{-\dfrac{1}{2}{{\left( \dfrac{x-\alpha }{\sigma } \right)}^{2}}}}}dx-{{\alpha }^{2}}=\int\limits_{-\infty }^{\infty }{\left( {{\alpha }^{2}}+{{t}^{2}}{{\sigma }^{2}}+2t\alpha \sigma \right)}\dfrac{1}{\sqrt{2\pi }}{{e}^{-\dfrac{1}{2}{{t}^{2}}}}dt-{{\alpha }^{2}}
x21σ2πe12(xασ)2dxα2=α212πe12t2dt+2tασ2πe12t2dt+t2σ22πe12t2dtα2\Rightarrow \int\limits_{-\infty }^{\infty }{{{x}^{2}}\dfrac{1}{\sigma \sqrt{2\pi }}{{e}^{-\dfrac{1}{2}{{\left( \dfrac{x-\alpha }{\sigma } \right)}^{2}}}}}dx-{{\alpha }^{2}}=\int\limits_{-\infty }^{\infty }{{{\alpha }^{2}}}\dfrac{1}{\sqrt{2\pi }}{{e}^{-\dfrac{1}{2}{{t}^{2}}}}dt+\int\limits_{-\infty }^{\infty }{\dfrac{2t\alpha \sigma }{\sqrt{2\pi }}{{e}^{-\dfrac{1}{2}{{t}^{2}}}}}dt+\int\limits_{-\infty }^{\infty }{\dfrac{{{t}^{2}}{{\sigma }^{2}}}{\sqrt{2\pi }}{{e}^{-\dfrac{1}{2}{{t}^{2}}}}}dt-{{\alpha }^{2}}
2tασ2πe12t2\dfrac{2t\alpha \sigma }{\sqrt{2\pi }}{{e}^{-\dfrac{1}{2}{{t}^{2}}}}is an odd function, so 2tασ2πe12t2dt\int\limits_{-\infty }^{\infty }{\dfrac{2t\alpha \sigma }{\sqrt{2\pi }}{{e}^{-\dfrac{1}{2}{{t}^{2}}}}}dt is equal to 0.
We know that e12t2\int\limits_{-\infty }^{\infty }{{{e}^{-\dfrac{1}{2}{{t}^{2}}}}} is equal to 20e12t22\int\limits_{0}^{\infty }{{{e}^{-\dfrac{1}{2}{{t}^{2}}}}} because it is an even functionx21σ2πe12(xασ)2dxα2=20α212πe12t2dt+20t2σ22πe12t2dtα2\Rightarrow \int\limits_{-\infty }^{\infty }{{{x}^{2}}\dfrac{1}{\sigma \sqrt{2\pi }}{{e}^{-\dfrac{1}{2}{{\left( \dfrac{x-\alpha }{\sigma } \right)}^{2}}}}}dx-{{\alpha }^{2}}=2\int\limits_{0}^{\infty }{{{\alpha }^{2}}}\dfrac{1}{\sqrt{2\pi }}{{e}^{-\dfrac{1}{2}{{t}^{2}}}}dt+2\int\limits_{0}^{\infty }{\dfrac{{{t}^{2}}{{\sigma }^{2}}}{\sqrt{2\pi }}{{e}^{-\dfrac{1}{2}{{t}^{2}}}}}dt-{{\alpha }^{2}}
0e12t2\int\limits_{0}^{\infty }{{{e}^{-\dfrac{1}{2}{{t}^{2}}}}} is equal to 12Γ12\dfrac{1}{\sqrt{2}}\Gamma \dfrac{1}{2} = π2\sqrt{\dfrac{\pi }{2}}
We can calculate 0t2e12t2\int\limits_{0}^{\infty }{{{t}^{2}}{{e}^{-\dfrac{1}{2}{{t}^{2}}}}} is equal to 2Γ32\sqrt{2}\Gamma \dfrac{3}{2} = π2\sqrt{\dfrac{\pi }{2}}
Replacing these values, we get
x21σ2πe12(xασ)2dxα2=2α2π2π2+2σ2π2π2α2\Rightarrow \int\limits_{-\infty }^{\infty }{{{x}^{2}}\dfrac{1}{\sigma \sqrt{2\pi }}{{e}^{-\dfrac{1}{2}{{\left( \dfrac{x-\alpha }{\sigma } \right)}^{2}}}}}dx-{{\alpha }^{2}}=\dfrac{2{{\alpha }^{2}}\sqrt{\pi }}{\sqrt{2\pi }\sqrt{2}}+\dfrac{2{{\sigma }^{2}}\sqrt{\pi }}{\sqrt{2\pi }\sqrt{2}}-{{\alpha }^{2}}
x21σ2πe12(xασ)2dxα2=α2+σ2α2\Rightarrow \int\limits_{-\infty }^{\infty }{{{x}^{2}}\dfrac{1}{\sigma \sqrt{2\pi }}{{e}^{-\dfrac{1}{2}{{\left( \dfrac{x-\alpha }{\sigma } \right)}^{2}}}}}dx-{{\alpha }^{2}}={{\alpha }^{2}}+{{\sigma }^{2}}-{{\alpha }^{2}}
x21σ2πe12(xασ)2dxα2=σ2\Rightarrow \int\limits_{-\infty }^{\infty }{{{x}^{2}}\dfrac{1}{\sigma \sqrt{2\pi }}{{e}^{-\dfrac{1}{2}{{\left( \dfrac{x-\alpha }{\sigma } \right)}^{2}}}}}dx-{{\alpha }^{2}}={{\sigma }^{2}}

So the variance is equal to σ2{{\sigma }^{2}}

Note: The definition of gamma function is Γ(x)=0tx1etdt\Gamma \left( x \right)=\int\limits_{0}^{\infty }{{{t}^{x-1}}{{e}^{-t}}dt} gamma of any positive integer is equal to factorial of the preceding number of that number. We can define gamma as Γ(x)=(x1)Γ(x1)\Gamma \left( x \right)=\left( x-1 \right)\Gamma \left( x-1 \right) . Definition of even function is f( x ) = f( -x). The graph of an even function is always symmetric with respect to y axis and the odd function is f( x) = -f (x ). The probability density function of gaussian or normal distribution which 1σ2πe12(xασ)2\dfrac{1}{\sigma \sqrt{2\pi }}{{e}^{-\dfrac{1}{2}{{\left( \dfrac{x-\alpha }{\sigma } \right)}^{2}}}} , the curve of this function is symmetric with respect to straight line x = α\alpha .