This is an old revision of this page, as edited by 194.75.78.178(talk) at 15:10, 30 March 2015(Fixed an error: It used alpha and beta in the one case, and then a and b thereafter.). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.Revision as of 15:10, 30 March 2015 by 194.75.78.178(talk)(Fixed an error: It used alpha and beta in the one case, and then a and b thereafter.)
Probability density function for the truncated normal distribution for different sets of parameters. In all cases, a = −10 and b = 10. For the black: μ = −8, σ = 2; blue: μ = 0, σ = 2; red: μ = 9, σ = 10; orange: μ = 0, σ = 10.
Cumulative distribution function
Cumulative distribution function for the truncated normal distribution for different sets of parameters. In all cases, a = −10 and b = 10. For the black: μ = −8, σ = 2; blue: μ = 0, σ = 2; red: μ = 9, σ = 10; orange: μ = 0, σ = 10.
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 has a normal distribution and lies within the interval . Then conditional on has a truncated normal distribution.
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
with the cumulative distribution function and its inverse, a uniform random number on , follows the distribution truncated to the range . This method is theoretically the best, however the simulation of random variables from and 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).
Robert, Christian P. (1995). "Simulation of truncated normal variables". Statistics and Computing. 5 (2): 121–125. doi:10.1007/BF00143942.
Barr, Donald R.; Sherrill, E.Todd (1999). "Mean and variance of truncated normal distributions". The American Statistician. 53 (4): 357–361. doi:10.1080/00031305.1999.10474490.
Bebu, Ionut; Mathew, Thomas (2009). "Confidence intervals for limited moments and truncated moments in normal and lognormal models". Statistics and Probability Letters. 79: 375–380. doi:10.1016/j.spl.2008.09.006.
Damien, Paul; Walker, Stephen G. (2001). "Sampling truncated normal, beta, and gamma densities". Journal of Computational and Graphical Statistics. 10 (2): 206–215. doi:10.1198/10618600152627906.
Nicolas Chopin, "Fast simulation of truncated Gaussian distributions". Statistics and Computing21(2): 275-288.