Solved – Truncated Normal distribution: Theoretical mean outside truncation boundaries

bayesiandistributionsrandom-generationtruncated normal distribution

I am working with a truncated normal as posterior distribution in a Bayesian estimation problem. Precisely, it is a normal distribution truncated at 0 from below.

When calculating the parameters of the posterior distribution, I sometimes end up with a negative mean parameter $\mu = -8.0 $ and a variance of $\sigma^2 = 0.2$.

However, I try to sample from a truncated normal with these parameters. Is it even possible to obtain a sample within $[0,\infty)$ using these parameters? According to my understanding that would require at least $18\sigma$ to compensate the negative mean of $-8.0$.

I assume something is wrong in the calculation of the mean of the posterior distribution here, since – for me – it doesn't seem reasonable to have a negative (theoretical) mean for a distribution which is truncated at 0 from below. Am I right here or is it possible to overcome the negativity caused by the mean?

Best Answer

$\mu$ parameter from truncated normal distribution describes it's mean before the truncation. The mean of the truncated normal distribution is

$$ \operatorname{E}(X \mid a<X<b) = \mu + \sigma\frac{\phi(\frac{a-\mu}{\sigma})-\phi(\frac{b-\mu}{\sigma})}{\Phi(\frac{b-\mu}{\sigma})-\Phi(\frac{a-\mu}{\sigma})} $$

where $a$ and $b$ are lower and upper truncation points. This mean is always between $a$ and $b$.

You are right that sampling from truncated normal distribution with parameters $\mu=-8$, $\sigma=0.2$, $a=0$, $b=\infty$ using non-specialized algorithm would be very inefficient (possibly you'd have problems with numbers falling below numerical precision), however since non-truncated normal distribution ranges from $-\infty$ to $\infty$, you can pick any truncation points such that $a < b$. Hopefully we have specialized algorithms that deal with such cases as the one described by Christian Robert (mentioned in a comment below).