Probability and Statistics

The Normal Density

The N(mu, sigma^2) density is e^(-(x-mu)^2 / (2 sigma^2)) over sigma sqrt(2 pi), the constant forced by the Gaussian integral, which is evaluated by squaring it and passing to polar coordinates.

solvedeasy1 min

Suppose X∼N(μ,σ2)X \sim N(\mu, \sigma^2), so XX is normally distributed with mean μ\mu and variance σ2\sigma^2. Write down the density fX(x)f_X(x). Where does the constant factor in front come from?

Reveal solutionHide solution

#The density

fX(x)=1σ2πexp⁡ ⁣(−(x−μ)22σ2).(1)f_X(x) = \frac{1}{\sigma\sqrt{2\pi}} \exp\!\left(-\frac{(x-\mu)^2}{2\sigma^2}\right). \tag*{(1)}(1)

#The constant is a normaliser

A density must integrate to 11, so the factor in front is whatever forces that, the reciprocal of the integral of the bare exponential shape. Call that shape integral

Z=∫−∞∞exp⁡ ⁣(−(x−μ)22σ2)dx.(2)Z = \int_{-\infty}^{\infty} \exp\!\left(-\frac{(x-\mu)^2}{2\sigma^2}\right) dx. \tag*{(2)}(2)

The substitution t=(x−μ)/σt = (x-\mu)/\sigma gives dx=σ dtdx = \sigma\, dt and strips out the parameters,

Z=σ∫−∞∞e−t2/2 dt.(3)Z = \sigma \int_{-\infty}^{\infty} e^{-t^2/2}\, dt. \tag*{(3)}(3)

#Evaluating the Gaussian integral

Let I=∫−∞∞e−t2/2 dtI = \int_{-\infty}^{\infty} e^{-t^2/2}\, dt. Squaring turns one integral into a plane integral that polar coordinates collapse,

I2=∫−∞∞ ⁣ ⁣∫−∞∞e−(u2+v2)/2 du dv=∫02π ⁣ ⁣∫0∞e−r2/2 r dr dθ.(4)I^2 = \int_{-\infty}^{\infty}\!\!\int_{-\infty}^{\infty} e^{-(u^2+v^2)/2}\, du\, dv = \int_0^{2\pi}\!\!\int_0^{\infty} e^{-r^2/2}\, r\, dr\, d\theta. \tag*{(4)}(4)

The radial piece is ∫0∞e−r2/2 r dr=1\int_0^{\infty} e^{-r^2/2}\, r\, dr = 1, so I2=2πI^2 = 2\pi and I=2πI = \sqrt{2\pi}.

#Normalising the Gaussian integral

Therefore Z=σ2πZ = \sigma\sqrt{2\pi}, and the normalising constant is its reciprocal,

1Z=1σ2π,(5)\frac{1}{Z} = \frac{1}{\sigma\sqrt{2\pi}}, \tag*{(5)}(5)

the exact factor standing in front of fXf_X.

area = 1
The exponential alone fixes the bell shape, peaking at the mean and falling off over a width of one standard deviation. The leading constant scales it so the shaded area is exactly 1, which is what makes the curve a probability density.