Expectation of the Half-Normal Distribution

The half-normal distribution follows from folding a centered normal distribution onto the positive axis.

The half-normal distribution arises when we take a centered normal random variable and keep only its magnitude. It is often used as a non-negative prior in Bayesian learning and also naturally models the size of fluctuations in processes like Brownian motion.

Formally, if

XN(0,σ2)(1)X \sim \mathcal N(0,\sigma^2) \tag{1}

with probability density function:

fX(x)=1σ2πexp ⁣(x22σ2)(2)f_X(x) = \frac{1}{\sigma\sqrt{2\pi}} \exp\!\left(-\frac{x^2}{2\sigma^2}\right) \tag{2}

then the random variable

Y=X(3)Y = |X| \tag{3}

is said to follow a half-normal disribution.

Deriving the Expectation

The expectation of the half-normal distribution has a clear practical meaning. For example, if we think of Brownian motion as modeling random fluctuations like particle movement, the expectation tells us the typical absolute distance from the starting point at a given time.

By the definition of the expectation of a random variable

E[X]=xfX(x)dx(4)\mathbb E[|X|] = \int_{-\infty}^{\infty} |x| f_X(x)\,dx \tag{4}

To integrate the absolute value of xx, we split the integral at zero, resulting in

E[X]=0(x)fX(x)dx+0xfX(x)dx(5)\mathbb E[|X|] = \int_{-\infty}^0 (-x) f_X(x)\,dx + \int_0^{\infty} x f_X(x)\,dx \tag{5}

Using the change of variables u=xu = -x, the first integral becomes

0ufX(u)du(6)\int_0^{\infty} u f_X(-u)\,du \tag{6}

and since fX(u)=fX(u)f_X(-u) = f_X(u) due to the symmetry of the normal density, the two integrals are equal and hence

E[X]=2σ2π0xexp ⁣(x22σ2)dx(7)\mathbb E[|X|] = \frac{2}{\sigma\sqrt{2\pi}} \int_0^{\infty} x \exp\!\left(-\frac{x^2}{2\sigma^2}\right) dx \tag{7}

To evaluate this integral, we use the substitution

u=x22σ2(8)u = \frac{x^2}{2\sigma^2} \tag{8} du=xσ2dxxdx=σ2du(9)du = \frac{x}{\sigma^2} dx \quad \Rightarrow \quad \tag{9} x\,dx = \sigma^2 du

which results in

0xex2/(2σ2)dx=σ20eudu=σ2(10)\int_0^{\infty} x e^{-x^2/(2\sigma^2)} dx = \sigma^2 \int_0^{\infty} e^{-u} du = \sigma^2 \tag{10}

Plugging the result back into Equation (7)

E[X]=2σ2πσ2=σ2π(11)\mathbb E[|X|] = \frac{2}{\sigma\sqrt{2\pi}} \cdot \sigma^2 = \sigma \sqrt{\frac{2}{\pi}} \tag{11}

which concludes the derivation.

As expected, taking the absolute value of a symmetric variable shifts all the mass to the positive side, making the expectation positive but still slightly below the standard deviation. Intuitively, this reflects that the typical size is bigger than zero but still smaller than the full spread. ​

Probability & Statistics