Processing math: 100%
SciPy

This is documentation for an old release of SciPy (version 0.17.0). 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)(1q)]

where

ϕ(x)=12πex2/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