$$\newcommand{\R}{\mathbb{R}}$$ $$\newcommand{\N}{\mathbb{N}}$$ $$\newcommand{\Z}{\mathbb{Z}}$$ $$\newcommand{ \E}{\mathbb{E}}$$ $$\newcommand{\P}{\mathbb{P}}$$ $$\newcommand{\var}{\text{var}}$$ $$\newcommand{\sd}{\text{sd}}$$ $$\newcommand{\bs}{\boldsymbol}$$ $$\newcommand{\sgn}{\text{sgn}}$$ $$\newcommand{\skw}{\text{skew}}$$ $$\newcommand{\kur}{\text{kurt}}$$
1. Random
2. 4. Special Distributions
3. The Folded Normal Distribution

## The Folded Normal Distribution

### The General Folded Normal Distribution

#### Introduction

The folded normal distribution is the distribution of the absolute value of a random variable with a normal distribution. As we have mentioned before, the normal distribution is perhaps the most important in probability and is used to model an incredible variety of random phenomena. Since one may only be interested in the magnitude of a normally distributed variable, the folded normal arises in a very natural way. The name stems from the fact that the probability measure of the normal distribution on $$(-\infty, 0]$$ is folded over to $$[0, \infty)$$. Here is the formal definition:

Suppose that $$X$$ has a normal distribution with mean $$\mu \in \R$$ and standard deviation $$\sigma \in (0, \infty)$$. Then $$Y = |X|$$ has the folded normal distribution with parameters $$\mu$$ and $$\sigma$$.

#### Distribution Functions

Suppose that $$Z$$ has the standard normal distribution. Recall that $$Z$$ has probability density function $$\phi$$ and distribution function $$\Phi$$ given by \begin{align} \phi(z) & = \frac{1}{\sqrt{2 \pi}} e^{-z^2 / 2}, \quad z \in \R \\ \Phi(z) & = \int_{-\infty}^z \phi(x) \, dx = \int_{-\infty}^z \frac{1}{\sqrt{2 \pi}} e^{-x^2 / 2} \, dx, \quad z \in \R \end{align} The standard normal distribution is so important that $$\Phi$$ is considered a special function and can be computed using most mathematical and statistical software. If $$\mu \in \R$$ and $$\sigma \in (0, \infty)$$, then $$X = \mu + \sigma Z$$ has the normal distribution with mean $$\mu$$ and standard deviation $$\sigma$$, and therefore $$Y = |X| = |\mu + \sigma Z|$$ has the folded normal distribution with parameters $$\mu$$ and $$\sigma$$.

$$Y$$ has distribution function $$F$$ given by \begin{align} F(y) & = \Phi\left(\frac{y - \mu}{\sigma}\right) - \Phi\left(\frac{-y - \mu}{\sigma}\right) = \Phi\left(\frac{y - \mu}{\sigma}\right) + \Phi\left(\frac{y + \mu}{\sigma}\right) - 1 \\ & = \int_0^y \frac{1}{\sigma \sqrt{2 \pi}} \left\{\exp\left[-\frac{1}{2}\left(\frac{x + \mu}{\sigma}\right)^2\right] + \exp\left[-\frac{1}{2} \left(\frac{x - \mu}{\sigma}\right)^2\right] \right\} \, dx, \quad y \in [0, \infty) \end{align}

Proof:

For $$y \in [0, \infty)$$, \begin{align} F(y) & = \P(Y \le y) = \P(|X| \le y) = \P(|\mu + \sigma Z| \le y) = \P(-y \le \mu + \sigma Z \le y) \\ & = \P\left(\frac{-y - \mu}{\sigma} \le Z \le \frac{y - \mu}{\sigma}\right) = \Phi\left(\frac{y - \mu}{\sigma}\right) - \Phi\left(\frac{-y - \mu}{\sigma} \right) \end{align} which gives the first expression. The second expression follows since $$\Phi(-z) = 1 - \Phi(z)$$ for $$z \in \R$$. Finally, the integral formula follows from the form of $$\Phi$$ given above and simple substitution.

We cannot compute the quantile function $$F^{-1}$$ in closed form, but values of this function can be approximated.

Open the special distribution calculator and select the folded normal distribution, and set the view to CDF. Vary the parameters and note the shape of the distribution function. For selected values of the parameters, compute the median and the first and third quartiles.

$$Y$$ has probability density function $$f$$ given by \begin{align} f(y) & = \frac{1}{\sigma} \left[\phi\left(\frac{y - \mu}{\sigma}\right) + \phi\left(\frac{y + \mu}{\sigma}\right)\right] \\ & = \frac{1}{\sigma \sqrt{2 \pi}} \left\{\exp\left[-\frac{1}{2}\left(\frac{y + \mu}{\sigma}\right)^2\right] + \exp\left[-\frac{1}{2} \left(\frac{y - \mu}{\sigma}\right)^2\right] \right\}, \quad y \in [0, \infty) \end{align}

Proof:

This follows from differentiating the CDF in Theorem 1 with respect to $$y$$, since $$F^\prime(y) = f(y)$$ and $$\Phi^\prime(z) = \phi(z)$$.

The folded normal distribution has a symmetry property that is not completely obvious from the initial definition:

For $$\mu \in \R$$ and $$\sigma \in (0, \infty)$$, the folded normal distribution with parameters $$-\mu$$ and $$\sigma$$ is the same as the folded normal distribution with parameters $$\mu$$ and $$\sigma$$.

Proof:

The PDF in the previous theorem is unchanged if $$\mu$$ is replaced with $$-\mu$$.

Open the special distribution simulator and select the folded normal distribution. Vary the parameters $$\mu$$ and $$\sigma$$ and note the shape of the probability density function. For selected values of the parameters, run the simulation 1000 times and compae the empirical density function to the true probability density function.

Note that the folded normal distribution is unimodal for some values of the parameters and decreasing for other values. Note also that $$\mu$$ is not a location parameter nor is $$\sigma$$ a scale parameter; both influence the shape of the probability density function.

#### Moments

We cannot compute the the mean of the folded normal distribution in closed form, but the mean can at least be given in terms of $$\Phi$$. On the other hand, the second moment of $$Y$$ is the same of $$X$$, which we know.

The first two moments of $$Y$$ are

1. $$\E(Y) = \mu [1 - 2 \Phi(-\mu / \sigma)] + \sigma \sqrt{2 / \pi} \exp(-\mu^2 / 2 \sigma^2)$$
2. $$\E(Y^2) = \mu^2 + \sigma^2$$
Proof:

Note that \begin{align} E(Y) & = \E(|\mu + \sigma Z|) = \E(\mu + \sigma Z; Z \ge -\mu / \sigma) - \E(\mu + \sigma Z; Z \le -\mu / \sigma) \\ & = \E(\mu + \sigma Z) - 2 \E(\mu + \sigma Z: Z \le - \mu / \sigma) = \mu -2 \mu \Phi(-\mu / \sigma) - 2 \sigma \E(Z; Z \le -\mu / \sigma) \end{align} So we just need to compute the last expected value. Using the change of variables $$u = z^2 / 2$$ we get $\E(Z; Z \le -\mu / \sigma) = \int_{-\infty}^{-\mu/\sigma} z \frac{1}{\sqrt{2 \pi}} e^{-z^2/2} \, dz = -\int_{\mu^2/2\sigma^2}^\infty \frac{1}{\sqrt{2\pi}} e^{-u} \, du = -\frac{1}{\sqrt{2 \pi}} e^{-\mu^2/2 \sigma^2}$ Substituting gives the result in (a). For (b), note that $$\E(Y^2) = \E(X^2) = \var(X) + [\E(X)]^2 = \sigma^2 + \mu^2$$.

In particular, the variance of the folded normal distribution is

$\var(Y) = \mu^2 + \sigma^2 - \left\{\mu \left[1 - 2 \Phi\left(-\frac{\mu}{\sigma}\right)\right] + \sigma \sqrt{\frac{2}{\pi}} \exp\left(-\frac{\mu^2}{2 \sigma^2}\right) \right\}^2$

Open the special distribution simulator and select the folded normal distribution. Vary the parameters and note the size and location of the mean$$\pm$$standard deviation bar. For selected values of the parameters, run the simulation 1000 times and compare the empirical mean and standard deviation to the true mean and standard deviation.

### The Half-Normal Distribution

When $$\mu = 0$$, results for the folded normal distribution are much simpler, and fortunately this special case is the most important one. We are more likely to be interested in the magnitude of a normally distributed variable when the mean is 0, and moreover, this distribution arises in the study of Brownian motion. Thus, let $$Y = |\sigma Z| = \sigma |Z|$$ where $$Z$$ has a standard normal distribution and $$\sigma \in (0, \infty)$$. Clearly $$\sigma$$ is a scale parameter, unlike the case for the general folded normal distribution. The distribution of $$Y$$ is called the half normal distribution with scale parameter $$\sigma$$. In the special case that $$\sigma = 1$$, $$Y = |Z|$$ has the standard half normal distribution.

#### Distribution Functions

The distribution function $$F$$ and quantile function $$F^{-1}$$ of $$Y$$ are \begin{align} F(y) & = 2 \Phi\left(\frac{y}{\sigma}\right) - 1 = \int_0^y \frac{1}{\sigma} \sqrt{\frac{2}{\pi}} \exp\left(-\frac{x^2}{2 \sigma^2}\right) \, dx, \quad y \in [0, \infty) \\ F^{-1}(p) & = \sigma \Phi^{-1}\left(\frac{1 + p}{2}\right), \quad p \in [0, 1) \end{align}

Proof:

The result for the CDF follows from the CDF of the folded normal distribution with $$\mu = 0$$. Recall that $$\Phi(-z) = 1 - \Phi(z)$$ for $$z \in \R$$. The result for the quantile function follows from the result for the CDF and simple algebra.

Open the special distribution calculator and select the folded normal distribution. Select CDF view and keep $$\mu = 0$$. Vary $$\sigma$$ and note the shape of the CDF. For various values of $$\sigma$$, compute the median and the first and third quartiles.

The probability density function $$f$$ of $$Y$$ is $f(y) = \frac{2}{\sigma} \phi\left(\frac{y}{\sigma}\right) = \frac{1}{\sigma} \sqrt{\frac{2}{\pi}} \exp\left(-\frac{y^2}{2 \sigma^2}\right), \quad y \in [0, \infty)$

Proof:

This follows from differentiating the CDF in the previous theorem.

Open the special distribution simulator and select the folded normal distribution. Keep $$\mu = 0$$ and vary $$\sigma$$, and note the shape of the probability density function. For selected values of $$\sigma$$, run the simulation 1000 times and compare the empricial density function to the true probability density function.

Note that $$f$$ is strictly decreasing on $$[0, \infty)$$ and so the mode is 0.

#### Moments

The moments of the half-normal distribution can be computed explicitly:

For $$n \in \N$$ \begin{align} \E(Y^{2n}) & = \sigma^{2n} \frac{(2n)!}{n! 2^n}\\ \E(Y^{2n+1}) & = \sigma^{2n+1} 2^n \sqrt{\frac{2}{\pi}} n! \end{align}

Proof:

The even order moments of $$Y$$ are the same as the even order moments of $$\sigma Z$$. These were computed in the section on the normal distribution. For the odd order moments we again use the simple substitution $$z = y^2 / 2$$ to get $\E(Y^{2n+1}) = \sigma^{2n+1} \int_0^\infty y^{2n+1} \sqrt{\frac{2}{\pi}} e^{-y^2/2} \, dy = \sigma^{2n+1} 2^n \sqrt{\frac{2}{\pi}} \int_0^\infty z^n e^{-z} \, dz = \sigma^{2n+1} 2^n \sqrt{\frac{2}{\pi}} n!$

In particular, we have $$\E(Y) = \sigma \sqrt{2/\pi}$$ and $$\var(Y) = \sigma^2(1 - 2 / \pi)$$

Open the special distribution simulator and select the folded normal distribution. Keep $$\mu = 0$$ and vary $$\sigma$$, and note the size and location of the mean$$\pm$$standard deviation bar. For selected values of $$\sigma$$, run the simulation 1000 times and compare the mean and standard deviation to the true mean and standard deviation.

#### Related Distributions

Since the half normal distribution is a scale family, it is trivially closed under scale transformations.

Suppose that $$Y$$ has the half-normal distribution with parameter $$\sigma$$ and that $$c \in (0, \infty)$$. Then $$c Y$$ has the half-normal distribution with parameter $$c \sigma$$.

Proof:

$$Y = \sigma Z$$ where $$Z$$ is standard normal. Hence $$c Y = c \sigma Z$$.

The standard half-normal distribution is also a special case of the chi distribution.

The standard half-normal distribution is the chi distribution with 1 degree of freedom.

Proof:

If $$Z$$ is a standard normal variable, then $$Z^2$$ has the chi-square distribution with 1 degree of freedom, and hence $$\left|Z\right| = \sqrt{Z^2}$$ has the chi distribution with 1 degree of freedom.