The normal density
Lesson 2.6.3 scaled the bell curve to area 1 and called it . Shift it to centre and stretch it sideways by , and you get the normal distribution with mean and standard deviation .
Rule: Normal distribution
and are in the units of . The second slot of holds the variance , not . The density is symmetric about , highest there, and has area 1 for every and .
The peak is : a wider bell is lower, so that its area stays 1. The curve bends from concave down to concave up (lesson 2.4.2) at and , which is where to look for on a graph.
Filling bottles. A machine fills bottles with millilitres: mean 500 ml, standard deviation 4 ml, variance 16 ml². The peak of its density is per ml.
The bell never reaches zero, so a normal variable can take any value. Values far from are possible but rare: the tails fall like , much faster than the exponential's of lesson 5.4.2.
Standardising
Lesson 5.3.2 standardised any random variable to mean 0 and variance 1. For a normal variable the result is again normal: the standard normal. The z-score of a value counts how many standard deviations it lies from the mean.
Rule: Standardising
has no units. In reverse, . Any probability for becomes one for , read off the single function .
has mean 0, since is symmetric about 0. Its variance is ; by parts (lesson 2.6.2) with and , so that , it is .
Then lesson 5.3.2's rules for give and : the parameters are the mean and the variance.
For the bottles, a fill below 495 ml has z-score , so . About one bottle in ten is under 495 ml.
| fill (ml) | 492 | 495 | 500 | 505 | 510 |
|---|---|---|---|---|---|
| z-score | 0 | 1.25 | 2.5 | ||
| 0.02275 | 0.10565 | 0.5 | 0.89435 | 0.99379 |
Exam scores. Scores are . A score above 85 is 1.5 standard deviations up, so .
and as probabilities
Lesson 2.6.3 computed areas under and called the area up to . A density's areas are probabilities (lesson 5.4.1), so those areas now answer questions about . is the distribution function of .
- is .
- The band from to 1.96 held 0.950004 of the area, so .
- The band from to 1 held 0.683, so .
- : half the time is negative.
Rule: Symmetry of the standard normal
The area above equals the area below , because is symmetric. For far tails use or norm.sf(z), not 1 - norm.cdf(z), which loses digits (case study 2.6.5).
Try it
norm(loc=500, scale=4) is : scale is , not . Its cdf and the standardised norm.cdf((x - 500) / 4) agree.
Then lesson 2.6.3's three areas, now probabilities. The last line checks by quad.
The 68–95–99.7 rule
Three numbers are worth knowing by heart. They hold for every normal, since standardising turns "within standard deviations of " into .
Rule: 68–95–99.7
Outside lies only 0.0027, about 1 value in 370. Outside lies 0.0000633, about 1 in 15,800.
The 68–95–99.7 rule for the bottle fills. Each band reaches one more standard deviation from the mean; the axis shows both the distance in standard deviations and the fill in ml.
For the bottles: 68.27% of fills lie between 496 and 504 ml, 95.45% between 492 and 508, and 99.73% between 488 and 512.
The bell is the same shape for every and . Move and , then set the interval to one standard deviation either side of the mean: it holds 0.6827 every time. Then try two standard deviations.
Explore
The curve is a density: probabilities are areas under it. Change the parameters, then set an interval and read the shaded area.
The dashed line is the mean.
- Probability
- P(−1 ≤ X ≤ 1) = 0.6827
- Mean
- 0
- Variance
- 1, so the standard deviation is 1
Quantiles
The -quantile of is , norm.ppf(p) in SciPy. Like itself, it has no formula and is computed numerically.
| 0.5 | 0.9 | 0.95 | 0.975 | 0.99 | |
|---|---|---|---|---|---|
| 0 | 1.281552 | 1.644854 | 1.959964 | 2.326348 |
By symmetry : the 0.01-quantile is .
Rule: Normal quantiles
Standardise backwards: go standard deviations from the mean. 1.96 is the behind "95% within 1.96 standard deviations": 2.5% lies beyond it on each side.
The lightest 1% of bottles hold less than ml.
Setting the machine. To make only 1% of bottles fall under 495 ml, the mean must sit 2.326348 standard deviations above 495: ml. This is the same equation, solved for .
The top 10% of exam scores start at .
Try it
norm.ppf gives the table's . Then the three examples: a bottle quantile, the mean that puts 1% under 495, and the exam's 0.9-quantile.
Linear changes and sums
A linear change of a normal variable is normal again. Lesson 5.3.2's rules give its mean and variance.
Rule: Linear change and sum
For . The second line needs and normal and independent (lesson 5.1.3); it is stated here, and lesson 5.6.3 shows why. Variances add; standard deviations do not.
A temperature in °F. If a temperature is in °C, then is in °F.
A pack of six bottles filled independently holds ml, so its standard deviation is ml, not . A pack under 2,980 ml has z-score and probability 0.020613.
A difference behaves the same way: is for two bottles, with standard deviation . The variances still add, because .
Try it
rng.normal(loc, scale, size) draws from ; scale is the standard deviation. Earlier lessons drew data this way, starting with case study 3.1.4.
The first line is the exact pack: its standard deviation, the z-score of 2,980 and its probability, then .
Then 100,000 packs of six bottles, in one seeded run. Their mean, standard deviation and share under 2,980 land near 3000, 9.798 and 0.0206. Last, the difference of two bottles.
Shape, and where the normal does not fit
Lesson 5.3.3 measured shape with skewness and kurtosis. The normal is the benchmark: skewness 0, because it is symmetric, and kurtosis 3. SciPy reports the excess kurtosis, kurtosis minus 3, so the normal's is 0: norm.stats(moments="mvsk") gives mean 0, variance 1, skewness 0 and excess kurtosis 0.
A normal model can mislead in two ways.
- It allows every value. Model a lifetime as years and : a negative lifetime one time in eleven. The lognormal of lesson 5.4.4 stays positive.
- Its tails are thin. Beyond it puts only 0.0000633. Many data sets, daily returns among them, have more values out there. Lesson 5.4.4 meets the Student t, and case study 5.4.6 compares both with return data.
Try it
The first line prints the four moments of the standard normal, with the excess kurtosis last.
Then the chance of a negative lifetime, and the tails beyond 3 and 4 standard deviations. Each comes with its "one in how many". norm.sf(k) is , so the two-sided tail is twice it.
Lesson 5.4.4 builds three distributions from the normal: the lognormal, the Student t and the chi-squared.
Common mistakes
- The second slot is the variance. has , and SciPy wants
norm(500, 4). - Standardise before reading . is , not .
- Use symmetry for the upper side. ; for far tails use
norm.sf. - Add variances, not standard deviations, for independent sums and for differences.
- Sums of normals are normal when they are independent (or, lesson 5.5.3, jointly normal). Normality alone is not enough.
- A normal model gives every value some probability, including impossible negative ones, and it understates extreme values in fat-tailed data.
The normal distribution
0 of 12 correct
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
- 9.
- 10.
- 11.
- 12.
How to type answers
- Powers with
^:x^7,2^(1/3),a^-2. - Multiply with
*or by writing side by side:3x^2,2(x+1). ln(x)is the natural log,log(x, 2)is log base 2,eis Euler's number,sqrt(x)is a square root.sin(x),cos(x)andtan(x)take radians; writepifor π andsin(x)^2for sin²x.- Your first answer to each question is saved: it counts towards your score and brings the question back for review.
- Exact answers like
ln(20)/ln(3)are best. Decimals need about 4 significant figures.
Summary card
- has density , mean and variance . In SciPy,
norm(loc=mu, scale=sigma). - is standard normal, so . is lesson 2.6.3's area, read as a probability; .
- 68.27%, 95.45% and 99.73% lie within 1, 2 and 3 standard deviations of the mean.
- Quantiles: , with from
norm.ppf: 1.645 for 0.95, 1.960 for 0.975, 2.326 for 0.99. - is normal, and independent normals add to a normal with the variances added.
rng.normal(mu, sigma, n)draws from . - Skewness 0, excess kurtosis 0. The normal gives negative values some probability and has thin tails.