JuliaStats/Distributions.jl — pull request #276 by LaurenceA (2014-08-14 15:39:47+00:00)
Title: Truncated normal variance

There are three changes, all of which help us to compute the moments of a truncated Gaussian.
First, there was a bug in the implementation of the variance for Truncated Normal moments.
Second, the moment calculations often fail because the normalizing constant has a large error. This has been fixed by making sure that we use ccdf if cdf(d, u) and cdf(d, l) are close to 1.
Third, tests have been added, one of which fails if the second alteration is not made.