Continuous distribution
Truncated normal distribution
A normal quantity that can only be seen, or can only occur, between and : the scores of applicants above an admission cut-off, a physical quantity with hard limits, a parameter whose prior must stay in a range. The density is the normal's, cut off outside and scaled up so the rest has total probability 1.
Truncated normal probability calculator
P(X ≤ 0.17) = 0.499441
At the parameters set by the sliders. The shaded region on the plot is the probability; the dots on the CDF mark F at its ends.
CDF
mean 0.2296 · variance 0.5198 · sd 0.7209 · mode 0 · entropy 1.005 nats
Formulas
| Parameters |
|
|---|---|
| Support | |
| CDF | |
| Mean | |
| Variance | |
| Mode | |
| MGF | |
| Entropy |
and are the standard normal density and CDF. and are not the mean and standard deviation of unless the interval is wide. SciPy's truncnorm takes the standardized bounds as a and b, with loc and scale .
Worked example
IQ scores are normal with mean 100 and standard deviation 15. A programme admits only people scoring above 120. What is the mean score of those admitted?
The admitted scores are normal truncated to : , , , so the mean is Selecting on a cut-off moves the mean well past the cut-off itself. answer checked by code
How it relates to others
- Special case→ Half-normal: A Normal() truncated to is Half-normal(). checked by code
- Limit→ Normal: As and , the truncated normal tends to the untruncated Normal(). checked by code
All the relationships, as a diagram →
In Python
from scipy import stats
import numpy as np
X = stats.truncnorm(a=-1, b=2, loc=0, scale=1)
X.pdf(0.5) # f(0.5) = 0.4301
X.cdf(0.5) # P(X ≤ 0.5) = 0.6509
X.mean(), X.var() # 0.2296, 0.5198
X.ppf(0.95) # 95th percentile
X.rvs(size=10, random_state=0)
rng = np.random.default_rng(0)
X.rvs(size=10, random_state=rng)NumPy has no truncated normal sampler, so this uses SciPy's, with NumPy's generator.
Choosing between this and its neighbours? Which distribution for proportions and probabilities? · Which distribution for measurements and errors?