This is documentation for an old release of SciPy (version 0.18.1). Search for this page in the documentation of the latest stable release (version 1.15.1).
Truncated Normal Distribution¶
A normal distribution restricted to lie within a certain range given by two parameters A and B . Notice that this A and B correspond to the bounds on x in standard form. For x∈[A,B] we get
f(x;A,B)=ϕ(x)Φ(B)−Φ(A)F(x;A,B)=Φ(x)−Φ(A)Φ(B)−Φ(A)G(q;A,B)=Φ−1[qΦ(B)+Φ(A)(1−q)]
where
ϕ(x)=1√2πe−x2/2Φ(x)=∫x−∞ϕ(u)du.
μ=ϕ(A)−ϕ(B)Φ(B)−Φ(A)μ2=1+Aϕ(A)−Bϕ(B)Φ(B)−Φ(A)−(ϕ(A)−ϕ(B)Φ(B)−Φ(A))2
Implementation: scipy.stats.truncnorm