# Truncated normal distribution

In probability and statistics, the truncated normal distribution is the probability distribution of a normally distributed random variable whose value is either bounded below or above (or both). The truncated normal distribution has wide applications in statistics and econometrics. For example, it is used to model the probabilities of the binary outcomes in the probit model and to model censored data in the Tobit model.

## Definition

Suppose ${\displaystyle X\sim N(\mu ,\sigma ^{2})\!}$ has a normal distribution and lies within the interval ${\displaystyle X\in (a,b),\;-\infty \leq a. Then ${\displaystyle X}$ conditional on ${\displaystyle a has a truncated normal distribution.

Its probability density function, ƒ, for ${\displaystyle a\leq x\leq b}$, is given by

${\displaystyle f(x;\mu ,\sigma ,a,b)={\frac {{\frac {1}{\sigma }}\phi ({\frac {x-\mu }{\sigma }})}{\Phi ({\frac {b-\mu }{\sigma }})-\Phi ({\frac {a-\mu }{\sigma }})}}}$

and by ƒ=0 otherwise.

## Moments

Two sided truncation:[1]

${\displaystyle \operatorname {E} (X\mid a
${\displaystyle \operatorname {Var} (X\mid a

One sided truncation (upper tail):[2]

${\displaystyle \operatorname {E} (X\mid X>a)=\mu +\sigma \lambda (\alpha )\!}$
${\displaystyle \operatorname {Var} (X\mid X>a)=\sigma ^{2}[1-\delta (\alpha )],\!}$

One sided truncation (lower tail):

${\displaystyle \operatorname {E} (X\mid X
${\displaystyle \operatorname {Var} (X\mid X

Barr and Sherrill (1999) give a simpler expression for the variance of one sided truncations. Their formula is in terms of the chi-square CDF, which is implemented in standard software libraries. Bebu and Mathew (2009) provide formulas for (generalized) confidence intervals around the truncated moments.

As for the non-truncated case, there is a neat recursive formula for the truncated moments. See.[3]

## Simulating

A random variate x defined as ${\displaystyle x=\Phi ^{-1}(\Phi (\alpha )+U\cdot (\Phi (\beta )-\Phi (\alpha )))\sigma +\mu }$ with ${\displaystyle \Phi }$ the cumulative distribution function and ${\displaystyle \Phi ^{-1}}$ its inverse, ${\displaystyle U}$ a uniform random number on ${\displaystyle (0,1)}$, follows the distribution truncated to the range ${\displaystyle (a,b)}$. This method is theoretically the best, however the simulation of random variables from ${\displaystyle \Phi }$ and ${\displaystyle \Phi ^{-1}}$ may imply numerical errors; thus practically one has to find other implementations.

For more on simulating a draw from the truncated normal distribution, see Robert (1995), Lynch (2007) Section 8.1.3 (pages 200–206), Devroye (1986). The MSM package in R has a function, rtnorm, that calculates draws from a truncated normal. The truncnorm package in R also has functions to draw from a truncated normal.

Chopin proposed an algorithm inspired from the Ziggurat algorithm of Marsaglia and Tsang (1984, 2000), which is usually considered as the fastest Gaussian sampler, and is also very close to Ahrens’s algorithm (1995). Implementations can be found in C, C++, Matlab and Python.

Sampling from the multivariate truncated normal distribution is considerably more difficult. Damien and Walker (2001) introduce a general methodology for sampling truncated densities within a Gibbs sampling framework. Their algorithm introduces one latent variable and is more computationally efficient than the algorithm of Robert (1995).

## References

1. Johnson, N.L., Kotz, S., Balakrishnan, N. (1994) Continuous Univariate Distributions, Volume 1, Wiley. ISBN 0-471-58495-9 (Section 10.1)
2. {{#invoke:citation/CS1|citation |CitationClass=book }}
• {{#invoke:citation/CS1|citation

|CitationClass=book }}

• Norman L. Johnson and Samuel Kotz (1970). Continuous univariate distributions-1, chapter 13. John Wiley & Sons.
• {{#invoke:citation/CS1|citation

|CitationClass=book }}

• {{#invoke:Citation/CS1|citation

|CitationClass=journal }}

• {{#invoke:Citation/CS1|citation

|CitationClass=journal }}

• {{#invoke:Citation/CS1|citation

|CitationClass=journal }}

• {{#invoke:Citation/CS1|citation

|CitationClass=journal }}

• Nicolas Chopin, "Fast simulation of truncated Gaussian distributions". Statistics and Computing 21(2): 275-288.
1. REDIRECT Template:Probability distributions