Probability & Statistics

The Normal Density

A normal variable with mean mu and variance sigma squared has the familiar bell-shaped density. What is its exact formula, and where does the constant factor in front of the exponential come from?

solvedeasy1 min

Suppose XN(μ,σ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}

#The constant is a normalizer

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}

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

Z=σet2/2dt.(3)Z = \sigma \int_{-\infty}^{\infty} e^{-t^2/2}\, dt. \tag{3}

#Evaluating the Gaussian integral

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

I2= ⁣ ⁣e(u2+v2)/2dudv=02π ⁣ ⁣0er2/2rdrdθ.(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}

The radial piece is 0er2/2rdr=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}.

#Result

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

1Z=1σ2π,(5)\frac{1}{Z} = \frac{1}{\sigma\sqrt{2\pi}}, \tag{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.