Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Leer Fundamental Properties and Intuition of the Gaussian Distribution | Gaussian Distribution
Probability Distributions for Machine Learning

bookFundamental Properties and Intuition of the Gaussian Distribution

The Gaussian distribution, also known as the normal distribution, is one of the most fundamental probability distributions in statistics and machine learning. It is characterized by its iconic bell-shaped curve, which is defined mathematically by two parameters: the mean (often denoted as μμ) and the variance (denoted as σ2σ²). The mean determines the center or location of the distribution, while the variance controls the spread or width of the curve.

f(xμ,σ2)=12πσ2exp((xμ)22σ2)f(x|\mu, \sigma^2) = \frac{1}{\sqrt{2\pi\sigma^2}} \exp\left(-\frac{(x-\mu)^2}{2\sigma^2}\right)
  • The mean (μμ): sets the peak of the bell curve. It is the average value around which the data is distributed;
  • The variance (σ2σ²): measures how much the data is spread out around the mean. A larger variance results in a wider, flatter curve; a smaller variance creates a narrower, taller curve.

This distribution is central to machine learning because many real-world phenomena tend to follow a Gaussian pattern due to the Central Limit Theorem, and it forms the foundation for many algorithms and statistical models.

123456789101112131415161718192021222324252627
import numpy as np import matplotlib.pyplot as plt # Generate x values x = np.linspace(-10, 10, 400) # Define different means and variances params = [ {"mu": 0, "sigma2": 1, "label": "μ=0, σ²=1"}, {"mu": 0, "sigma2": 4, "label": "μ=0, σ²=4"}, {"mu": 2, "sigma2": 1, "label": "μ=2, σ²=1"}, {"mu": -2, "sigma2": 0.5, "label": "μ=-2, σ²=0.5"}, ] plt.figure(figsize=(8, 5)) for p in params: mu = p["mu"] sigma = np.sqrt(p["sigma2"]) y = (1 / (np.sqrt(2 * np.pi) * sigma)) * np.exp(-0.5 * ((x - mu) / sigma) ** 2) plt.plot(x, y, label=p["label"]) plt.title("Gaussian Distributions with Varying Means and Variances") plt.xlabel("x") plt.ylabel("Probability Density") plt.legend() plt.grid(True) plt.show()
copy

By examining the plotted curves, you can see how the mean and variance parameters shape the Gaussian distribution. Shifting the mean (μμ) moves the center of the curve left or right along the x-axis, without affecting its width. Adjusting the variance (σ2σ²) changes the spread: a larger variance results in a flatter, wider curve, while a smaller variance produces a taller, narrower peak. These properties are crucial in machine learning, where the mean can represent an expected value and the variance reflects uncertainty or variability in your data. Understanding how these parameters influence the distribution's shape helps you interpret model assumptions and the behavior of algorithms that rely on the Gaussian distribution.

question mark

Which of the following statements about the Gaussian distribution are true?

Select the correct answer

Was alles duidelijk?

Hoe kunnen we het verbeteren?

Bedankt voor je feedback!

Sectie 2. Hoofdstuk 1

Vraag AI

expand

Vraag AI

ChatGPT

Vraag wat u wilt of probeer een van de voorgestelde vragen om onze chat te starten.

Suggested prompts:

Can you explain why the Gaussian distribution is so important in machine learning?

How does the Central Limit Theorem relate to the Gaussian distribution?

Can you give examples of algorithms that use the Gaussian distribution?

bookFundamental Properties and Intuition of the Gaussian Distribution

Veeg om het menu te tonen

The Gaussian distribution, also known as the normal distribution, is one of the most fundamental probability distributions in statistics and machine learning. It is characterized by its iconic bell-shaped curve, which is defined mathematically by two parameters: the mean (often denoted as μμ) and the variance (denoted as σ2σ²). The mean determines the center or location of the distribution, while the variance controls the spread or width of the curve.

f(xμ,σ2)=12πσ2exp((xμ)22σ2)f(x|\mu, \sigma^2) = \frac{1}{\sqrt{2\pi\sigma^2}} \exp\left(-\frac{(x-\mu)^2}{2\sigma^2}\right)
  • The mean (μμ): sets the peak of the bell curve. It is the average value around which the data is distributed;
  • The variance (σ2σ²): measures how much the data is spread out around the mean. A larger variance results in a wider, flatter curve; a smaller variance creates a narrower, taller curve.

This distribution is central to machine learning because many real-world phenomena tend to follow a Gaussian pattern due to the Central Limit Theorem, and it forms the foundation for many algorithms and statistical models.

123456789101112131415161718192021222324252627
import numpy as np import matplotlib.pyplot as plt # Generate x values x = np.linspace(-10, 10, 400) # Define different means and variances params = [ {"mu": 0, "sigma2": 1, "label": "μ=0, σ²=1"}, {"mu": 0, "sigma2": 4, "label": "μ=0, σ²=4"}, {"mu": 2, "sigma2": 1, "label": "μ=2, σ²=1"}, {"mu": -2, "sigma2": 0.5, "label": "μ=-2, σ²=0.5"}, ] plt.figure(figsize=(8, 5)) for p in params: mu = p["mu"] sigma = np.sqrt(p["sigma2"]) y = (1 / (np.sqrt(2 * np.pi) * sigma)) * np.exp(-0.5 * ((x - mu) / sigma) ** 2) plt.plot(x, y, label=p["label"]) plt.title("Gaussian Distributions with Varying Means and Variances") plt.xlabel("x") plt.ylabel("Probability Density") plt.legend() plt.grid(True) plt.show()
copy

By examining the plotted curves, you can see how the mean and variance parameters shape the Gaussian distribution. Shifting the mean (μμ) moves the center of the curve left or right along the x-axis, without affecting its width. Adjusting the variance (σ2σ²) changes the spread: a larger variance results in a flatter, wider curve, while a smaller variance produces a taller, narrower peak. These properties are crucial in machine learning, where the mean can represent an expected value and the variance reflects uncertainty or variability in your data. Understanding how these parameters influence the distribution's shape helps you interpret model assumptions and the behavior of algorithms that rely on the Gaussian distribution.

question mark

Which of the following statements about the Gaussian distribution are true?

Select the correct answer

Was alles duidelijk?

Hoe kunnen we het verbeteren?

Bedankt voor je feedback!

Sectie 2. Hoofdstuk 1
some-alt