Cross Validated is a question and answer site for people interested in statistics, machine learning, data analysis, data mining, and data visualization. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Suppose I have a black box that generates data following a normal distribution with mean m and standard deviation s. Suppose, however, that whenever it outputs a value < 0 it does not record anything (can't even tell that it's outputted such a value). We have a truncated gaussian distribution without a spike.

How can I estimate these parameters?

share|improve this question
I changed the tag from "truncated-gaussian" to "truncation" because most answers will be potentially useful in situations involving other distributions. – whuber Aug 23 '10 at 14:21

The model for your data would be:

$y_i \sim N(\mu,\sigma^2) I(y_i > 0)$

Thus, the density function is:

$$f(y_i|-) = \frac{exp(-\frac{(y_i-\mu)^2}{2 \sigma^2})}{\sqrt{2 \pi \sigma}\ (1 - \phi(-\frac{\mu}{\sigma}))}$$


$\phi(.)$ is the standard normal cdf.

You can then estimate the parameters $\mu$ and $\sigma$ using either maximum likelihood or bayesian methods.

share|improve this answer

As Srikant Vadali has suggested, Cohen and Hald solved this problem using ML (with a Newton-Raphson root finder) around 1950. Another paper is Max Halperin's "Estimation in the Truncated Normal Distribution" available on JSTOR (for those with access). Googling "truncated gaussian estimation" produces lots of useful-looking hits.

share|improve this answer

With having a technical border TB for $a=0$ a simplified approach by H. Schneider is very usefull to calculate the mean $\mu_t$ and standard deviation $\sigma_t$ of the truncated normal distribution:

  1. calculate the mean $\mu$ and the standard deviation $\sigma$ (entire population!) for the data set:

    $\mu = \bar{x}= \frac{1}{n} \sum_{i=1}^{n}x_i$

    $\sigma = s = \sqrt{\frac{1}{n} \sum_{i=1}^{n}(x_i-\bar{x})^2}$

  2. check if the technical border $TB=a=0$ has a valid distance to the average $\bar{x}$:

    consideration of $TB = a$ is not necessary when $\bar{x} \le 3s$

  3. calculate $\omega, P_3(\omega), P_4(\omega)$ and $Q(\omega)$:

    $\omega = \frac{s^2}{(a-\bar{x})^2}$

    $P_3(\omega) = 1+5,74050101\omega - 13,53427037\omega^2 + 6,88665552\omega^3$

    $P_4(\omega) = -0,00374615 + 0,17462558\omega - 2,87168509\omega^2 + 17,48932655\omega^3 - 11,91716546\omega^4$

    $Q(\omega) = \frac{P_4(\omega)}{P_3(\omega)}$

  4. check if $\omega \le 0,57081$, otherwise the mean $\mu_t$ is $<0$ which is not useful technically

  5. calculate $\mu_t$ and $\sigma_t$ for the truncated normal distribution:

    $\mu_t = \bar{x} + Q(\omega) \cdot (a-\bar{x})$

    $\sigma_{t}^{2} = s^2 + Q(\omega) \cdot (a-\bar{x})^2$

That's all...

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.