Note: Merged in to Distributions.jl, see JuliaStats/Distributions.jl#1058, JuliaStats/Distributions.jl#691.
Install with
using Pkg
Pkg.add(url="https://github.com/cossio/TruncatedNormal.jl")
This package does not export any symbols. The following functions are defined.
Mean of the truncated standard normal distribution:
TruncatedNormal.tnmean(a,b)
Mean of the truncated normal distribution, where μ,σ are the mean and standard deviation of the untruncated distribution:
TruncatedNormal.tnmean(a, b, μ, σ)
Variance of the truncated standard normal distribution:
TruncatedNormal.tnvar(a,b)
Variance of the truncated normal distribution, where μ,σ are the mean and standard deviation of the untruncated distribution:
TruncatedNormal.tnvar(a, b, μ, σ)
It works even if the truncation interval is far from the mode of the distribution. See https://github.com/cossio/TruncatedNormal.jl/blob/master/notes/normal.pdf for mathematical details.