AI Hints
Home›Statistics & Math for ML Tutorial›The Normal Distribution
Statistics & Math for ML · Lesson 43 of 138

The Normal Distribution

The bell curve.

⏱ 2 min read▶ Video at 49:01🎓 Free
Watch this lesson in the Statistics & Math for ML courseWatch on YouTube ↗Full Statistics & Math for ML course

Heights, measurement errors, and test scores often make the same shape. A smooth, symmetric hill, highest in the middle. It's called the normal distribution, or the bell curve, and it's everywhere in statistics.

The Normal Distribution
From the video: The Normal Distribution
  • Heights, errors, scores
  • A symmetric hill
  • The bell curve

Two settings

A normal distribution has two settings. The mean, mu, sets where the centre is. The standard deviation, sigma, sets how wide it is. Norm dot PDF gives the height of the curve. Run it. Changing the mean slides the bell. A bigger sigma makes it wider and flatter.

normal.pypython
import numpy as np
import matplotlib.pyplot as plt
from scipy.stats import norm

x = np.linspace(-8, 12, 400)
for mu, sigma in [(0, 1), (0, 2), (4, 1)]:
    plt.plot(x, norm.pdf(x, mu, sigma), label=f"mu={mu}, sigma={sigma}")
plt.title("Normal distributions"); plt.legend()
plt.savefig("normal.png")

Why it is everywhere

When many small, independent effects add together, the result tends to be normal. Your height comes from many genes, and many things about how you grew up. Measurement error comes from many tiny disturbances. We'll see why this happens later, with the central limit theorem.

keyvalue
muthe centre
sigmathe width
Symmetricmean = median = mode
Whymany small effects add up

Summary

The normal distribution is the bell curve, set by its mean and standard deviation. Next, a handy rule for reading it.

Key takeaways
  • norm.pdf(x, mu, sigma)
  • mu moves it
  • sigma widens it
Next up: The 68-95-99.7 Rule — within 1, 2, 3 SDs