0% found this document useful (0 votes)
3 views72 pages

Lect - 07 C Gaussain Distribution

The document provides an overview of Gaussian (Normal) Distribution, focusing on its definition, properties, and applications in various fields such as engineering and medicine. It explains the Probability Density Function (PDF) and Cumulative Distribution Function (CDF), along with how to calculate the mean, median, variance, and standard deviation. Additionally, it includes practical examples and MATLAB functions for implementing Gaussian distribution calculations.

Uploaded by

emelkara0003
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views72 pages

Lect - 07 C Gaussain Distribution

The document provides an overview of Gaussian (Normal) Distribution, focusing on its definition, properties, and applications in various fields such as engineering and medicine. It explains the Probability Density Function (PDF) and Cumulative Distribution Function (CDF), along with how to calculate the mean, median, variance, and standard deviation. Additionally, it includes practical examples and MATLAB functions for implementing Gaussian distribution calculations.

Uploaded by

emelkara0003
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 72

Probability and Statistics

EEF 271E

Ibraheem Shayea
Electronics and Communication Engineering Department,
Faculty of Electrical and Electronics Engineering
İstanbul Teknik Üniversitesi - İTÜ
Syllabus 07
Continuous Probability Distributions Functions

Part C
Gaussian (Normal) Distribution
Lecture Objectives
What you should Learn from this Lecture ?
❑ Understanding :
o Concept of Gaussian Distribution
o How PDF can be formulated?
o How CDF can be formulated?
o How it can b used in Matlab
o How is the Mean can be formulated?
o How is the Median can be formulated?
o How is theVariance can be formulated?
o How is the Standard Deviation can be formulated?
o Practice some Examples
Outline
❖ Concept of Gaussian Distribution

❖ PDF of Gaussian Distribution

❖ CDF of Gaussian Distribution

❖ Mean

❖ Median

❖ Variance

❖ Standard Deviation

❖ Properties

❖ Examples
Concept of Gaussian Distribution
Concept of Gaussian Distribution
Definition

❖ Gaussian Distribution Function is also known as the Normal


Distribution function or the bell curve.

❖ Gaussian Distribution Function is a type of probability


distribution that is symmetric and bell-shaped.

❖ Gaussian Distribution Function is a curve that represents the


likelihood (probability) of different outcomes around a central
value.
6
Concept of Gaussian Distribution
Gaussian Distribution Function
Gaussian Distribution Function

Dataset 7
Concept of Gaussian Distribution
Important of Gaussian Distribution Function

Gaussian distribution function is important distribution as


it can be used to describes the behaviour of a very large of natural
phenomena and is also used as a mathematical model in various fields of
science.
Examples:
o Engineering,
o Social sciences,
o Business, and
o Medicine.
8
o …etc
Concept of Gaussian Distribution
Important of Gaussian Distribution Function

Many statistical methods and tests are based on the assumption that
the underlying data follows a Gaussian Distribution.

Examples:
o Heights
o Blood pressure
o Measurement error
o Scores

follow the normal distribution. 9


Concept of Gaussian Distribution
Definition

Gaussian Distribution Function is a probability distribution


function that describes how the values of a random variable are
spread around the mean. It is characterized by its bell-shaped curve,
with the highest point at the mean, and symmetrical tails extending
infinitely in both directions.
10
PDF of Gaussian Distribution
PDF of Gaussian Distribution
PDF of Gaussian Distribution Function
The Probability Density Function (PDF) of the Gaussian random
variable X is defined as follows:

− 𝒙−𝝁 𝟐
𝟏
𝑓 𝑥 = 𝒆 𝟐𝝈𝟐 −∞ <𝒙<∞
𝟐𝝅 𝝈𝟐

where:
o 𝒙 is the random variable.
o 𝝁 is the mean of the distribution.
o 𝝈 is the standard deviation of the distribution.
o 𝒆 is the base of the natural logarithm.
o 𝝅 is the mathematical constant pi (approximately 3.14159). 12
PDF of Gaussian Distribution
PDF of Gaussian Distribution Function
𝝁 mean
▪ can have any finite real value, i.e. −∞ < 𝝁 < ∞
▪ The mean 𝝁 is often referred to as a Location Parameter.

𝝈 Standard Deviation
▪ it is often referred to as a Shape Parameter
▪ 𝝈 can have any finite positive value, i.e. 𝟎 < 𝝈 < ∞

𝝈𝟐 Variance
▪ 𝝈𝟐 can have any finite positive value, i.e. 𝟎 < 𝝈𝟐 < ∞
13
PDF of Gaussian Distribution
PDF of Gaussian Distribution Function
What is Gaussian Distribution Function ?

Other definition for Gaussian Distribution Function from different


perspective:

Gaussian Distribution Function is characterized by a bell-shaped


curve that is symmetrical about its Mean, μ, which represents the
average value of the data. The width of the curve is determined by the
Standard Deviation, 𝝈, which measures the spread of the data
around the mean.

14
PDF of Gaussian Distribution
Empirical Rule in Gaussian Distribution

𝟐𝝈

𝝈 𝝈

o ≈ 68% of the data falls within 1st standard deviation of the mean
o ≈ 95% of the data falls within 2nd standard deviations of the mean
o ≈ 99.7% of the data falls within 3ed standard deviations of the mean 15
PDF of Gaussian Distribution
Empirical Rule in Gaussian Distribution

16
PDF of Gaussian Distribution
Empirical Rule in Gaussian Distribution
Example

𝟐 𝝈

𝝈 𝝈

𝟏𝒔𝒕 𝝈 𝟐𝒏𝒅 𝝈 𝟑𝒆𝒅 𝝈

o ≈ 68% of the data falls within 1 standard deviation of the mean


o ≈ 95% of the data falls within 2 standard deviations of the mean
o ≈ 99.7% of the data falls within 3 standard deviations of the mean
17
PDF of Gaussian Distribution
Empirical Rule in Gaussian Distribution
Example

𝟐𝝈

𝝈 𝝈

𝟏𝒔𝒕 𝝈 𝟐𝒏𝒅 𝝈 𝟑𝒆𝒅 𝝈

o ≈ 68% of the data falls within 1 standard deviation of the mean


o ≈ 95% of the data falls within 2 standard deviations of the mean
o ≈ 99.7% of the data falls within 3 standard deviations of the mean
18
PDF of Gaussian Distribution
Peak of Gaussian Distribution
The corresponding PDF of X for Gaussian Distribution

PDF of X for Gaussian Distribution 19


PDF of Gaussian Distribution
Peak of Gaussian Distribution
Example

Impact of different 𝝈 values on the peak of PDF Gaussian distribution.

𝟐𝝈

𝟐𝝈

Figure Two examples of a Gaussian random variable X with expected value µ and standard deviation
20

σ.
PDF of Gaussian Distribution
Peak of Gaussian Distribution
Example
Impact of different 𝝈 values on the peak of PDF Gaussian distribution.

Figure PDFs of the Gaussian distribution with mean 𝜇 and variance 𝝈𝟐 . 21


PDF of Gaussian Distribution
Matlab Function for PDF Gaussian Distribution

PDFs of the Gaussian distribution with mean 𝜇 and variance 𝝈𝟐 is


represented in Matlab by the following function .

𝒇 𝒙 = normpdf(x, mu, sigma);

where:
o normpdf
ox
o mu
o sigma
PDF of Gaussian Distribution
Matlab Function for PDF Gaussian Distribution
Matlab Example
𝑓 𝑥 = normpdf(x, mu, sigma);

x = [-2: 0.1 : 2];

mu = 0;
𝟐𝝈
sigma = 1;

y = normpdf(x, mu, sigma);

plot(x, y)

Figure PDFs of the Gaussian distribution with mean 𝜇 and variance 𝝈𝟐 . 23


PDF of Gaussian Distribution
Matlab Function for PDF Gaussian Distribution
Matlab Example
𝑓 𝑥 = normpdf(x, mu, sigma);

x = [-10: 0.1 :10];

mu = 0;
𝟐𝝈

sigma = 1;

y = normpdf(x, mu, sigma);

plot(x,y)

Figure PDFs of the Gaussian distribution with mean 𝜇 and variance 𝝈𝟐 . 24


PDF of Gaussian Distribution
Matlab Function for PDF Gaussian Distribution
Matlab Example

𝟐𝝈 𝟐𝝈

𝟐𝝈

x = [-2:0.1:2]; x = [-2:0.1:2]; x = [-2:0.1:2];

mu = 0; mu = 0; mu = 0;
sigma = 0.5; sigma = 1; sigma = 2;

y = normpdf(x, mu, sigma); y = normpdf(x, mu, sigma); y = normpdf(x, mu, sigma);

figure figure figure


plot(x,y) plot(x,y) plot(x,y)

25
Figure PDFs of the Gaussian distribution with mean 𝜇 and variance 𝜎 2 .
PDF of Gaussian Distribution
Matlab Function for PDF Gaussian Distribution
Matlab Example

x = [-2:0.1:2];
sigma = 0.5
mu = 0;
sigma = 0.5, 1, 2;

y = normpdf(x, mu, sigma);

figure
plot(x,y)

sigma = 1

sigma = 2

Figure PDFs of the Gaussian distribution with mean 𝜇 and variance 𝜎 2 . 26


CDF of Gaussian Distribution
CDF of Gaussian Distribution
CDF of Gaussian Distribution

The CDF of X for Gaussian Distribution is:

??
28
CDF of Gaussian Distribution
CDF of Gaussian Distribution

The CDF of X for Gaussian Distribution is:

𝑭𝑿 𝒙 = න 𝒇𝑿 𝒙 𝒅𝒙

− 𝒙−𝝁 𝟐
𝟏
𝑓 𝑥 = 𝒆 𝟐𝝈𝟐 −∞ <𝒙<∞
𝟐𝝅 𝝈𝟐

?? 29
CDF of Gaussian Distribution
CDF of Gaussian Distribution

The CDF of X for Gaussian Distribution is:

??
30
CDF of Gaussian Distribution
CDF of Gaussian Distribution Function
The cumulative distribution function of the Gaussian random variable, which
is a continuous increasing function, is obtained as follows:

𝑭𝑿 𝒙 = න 𝒇𝑿 𝒙 𝒅𝒙


1 − 𝑥 − 𝜇 2 Τ2𝜎 2
𝐹𝑋 𝑥 = න 𝑒 𝑑𝑥 −∞ <𝑥 <∞
2𝜋 𝜎 2
−∞

31
CDF of Gaussian Distribution
Z-score

A. Convert the value to a Z-Score:

The Z-score is calculated as:

𝑋 − 𝜇
𝑍 =
𝜎

This standardizes X to the standard normal distribution.

32
CDF of Gaussian Distribution
Z-score

B. Look Up the Cumulative Probability:

❖ The Z-Table provides the cumulative probability 𝑃(𝑍 ≤ 𝑧), which


represents the area under the curve from −∞ 𝒕𝒐 𝒛.

❖ The table rows and columns are organized for different values of z,
typically up to two decimal places (e.g., 𝑧 = 1.96).

33
CDF of Gaussian Distribution
Z-score How to Use the Z-Table:

34
https://math.arizona.edu/~jwatkins/normal-table.pdf
CDF of Gaussian Distribution
Z-score How to Use the Z-Table:

𝑧 = 1.96

𝐹 𝑍 ≤ 1.96 = 0.9750

https://math.arizona.edu/~jwatkins/normal-table.pdf
CDF of Gaussian Distribution

Z-score
Example
Let's say you want to find the probability that a value is less than 85 in a
distribution where:
❖ 𝑀𝑒𝑎𝑛 𝜇 = 100
❖ 𝑆𝑡𝑑 𝜎 = 15

Step 1: Compute z-score:

Step 2: Look up 𝒇(−𝟏):


𝑓(−1) ≈ 0.1587

So the 𝑭(𝟖𝟓) = 𝟎. 𝟏𝟓𝟖𝟕, meaning there's a 𝟏𝟓. 𝟖𝟕% chance a value from this distribution is less
than or equal to 85.
CDF of Gaussian Distribution
Z-score How to Use the Z-Table:

𝑧 = −1

𝑓(−1) ≈ 0.1587

https://math.arizona.edu/~jwatkins/normal-table.pdf
CDF of Gaussian Distribution
Matlab for CDF of Gaussian Distribution

Matlab

CDFs of the Gaussian distribution with mean 𝜇 and variance 𝜎 2 is represented in


Matlab by the following function .

pd = makedist('Normal');
𝑭 𝒙 = cdf(pd,x);

pd is a probability distribution
38
CDF of Gaussian Distribution
Matlab for CDF of Gaussian Distribution

clc
clear all
close all

x = [-4:0.1:4];

mu = 0;
sigma = 1;

y = normpdf(x, mu, sigma);

pd = makedist('Normal');
cdfp = cdf(pd,x);

figure
plot(x, cdfp); hold on

pd is a probability distribution object representing


the desired probability distribution, 39
CDF of Gaussian Distribution
PDF and CDF of the Gaussian Distribution
❑ The corresponding PDF and CDF of X for Gaussian Distribution

PDF of X for Gaussian Distribution CDF of X for Gaussian Distribution

Gaussian Distribution 40
Mean
Mean
Mean Formula
❖ The mean of a Gaussian distribution function is also known
as the expected value or the average of the function.

❖ The formula for calculating the mean of a Gaussian distribution


function is:


Mean = ‫׬‬−∞ x f(x) dx

where
o 𝒇(𝒙) is the PDF of Gaussian distribution function,

o ‫׬‬−∞ is the integral is taken over the entire real line.
42
Mean
Mean Formula

Mean = ‫׬‬−∞ x f(x) dx


1 2 Τ2𝜎 2
Mean = න 𝑥 𝑒 − 𝑥 − 𝜇 𝑑𝑥
2𝜋 𝜎2
−∞

Mean = 𝜇

where
o μ is the mean,
o 𝒇(𝒙) is the PDF of Gaussian distribution function,

o ‫׬‬−∞ is the integral is taken over the entire real line. 43
Mean
Mean in Matlab

Matlab Function for mean

mu = mean(x);

clc
clear all
close all

x1 = [-4:4];
x2 = [-10:-5];
x = [x2 x1];

mu = mean(x); 44
Mean
Mean in Matlab
Matlab Function for mean
clc
clear all
close all
x1 = [-4:4];
x2 = [-10:-5];
x = [x2 x1];
mu = mean(x);

sigma = 1;

y = normpdf(x, mu, sigma);

fun = @(x) x .* normpdf(x, mu, sigma);


mean_value = integral(fun,-10,4); mu = 3
mu2 = mean_value; mu2 = 3
45
𝑴𝒆𝒅𝒊𝒂𝒏
𝑴𝒆𝒅𝒊𝒂𝒏
What is 𝑴𝒆𝒅𝒊𝒂𝒏?

The median of a Gaussian distribution function is the


value that divides the distribution into two halves of equal
probability density. In other words, it is the value such that half of
the area under the curve lies to the left of the median and half of
the area lies to the right of the median.

47
𝑴𝒆𝒅𝒊𝒂𝒏
Median Formula
o In Gaussian (Normal) Distribution, mean and median are
equal; both located at the center of the distribution

o Median of Gaussian Distribution Function is given by:

Median = Mean = 𝝁𝑿 = 𝝁

48
𝑴𝒆𝒅𝒊𝒂𝒏
𝑴𝒆𝒅𝒊𝒂𝒏 in Matlab
o Also, median of Gaussian Distribution Function can be calculated by:

median = mu + sigma * sqrt(2) * norminv(0.5);

norminv Inverse of the normal cumulative distribution function (cdf).

X = norminv(P,MU,SIGMA) returns the inverse cdf for the normal


distribution with mean MU and standard deviation SIGMA, evaluated at the
values in P. The size of X is the common size of the input arguments. A
scalar input functions as a constant matrix of the same size as the other
inputs.

49
𝑴𝒆𝒅𝒊𝒂𝒏
𝑴𝒆𝒅𝒊𝒂𝒏 in Matlab
clc
clear all
close all

x1 = [-4:4];
x2 = [-10:-5];
x = [x2 x1];

mu = mean(x);
sigma = 1; % sigma can be 1, 2, 3, or 4, but will not impact median

y = normpdf(x, mu, sigma);

fun = @(x) x .* normpdf(x, mu, sigma);


mean_value = integral(fun,-10,4);
mu2 = mean_value; With all
different values
N = length(x);
sigma = sqrt(sum((x-mu).^2)./N); of sigma the
median = mu + sigma * sqrt(2) * norminv(0.5); median will be
the same 3
50
Variance
Variance
What is Variance ?
❖ Variance of a Gaussian Distribution Function is a measure of
how spread out the distribution is around its mean.

❖ In simpler terms, the variance tells us how much the values in a


dataset are likely to deviate from the mean.
o A low variance indicates that the data points are clustered
closely around the mean,
o A high variance indicates that the data points are spread out
over a wider range of values.

❖ Variance is denoted by the symbol 𝝈𝟐𝑿 and is defined as the average


of the squared differences from the mean.
52
Variance
Variance
The Variance 𝝈𝟐𝑿 of Gaussian Distribution Function is given by:

𝜎𝑋2 = න 𝑥 − 𝜇𝑋 2 𝑓 𝑥 𝑑𝑥
𝑎

Where
𝜎𝑋2 The Variance for Distribution Function
𝑓𝑋 𝑥 The PDF for Gaussian Distribution Function, which is the value
of the PDF at any 𝑥 value
𝜇𝑋 The Mean for Gaussian Distribution Function
𝑎 The minimum value of 𝑥
𝑏 The maximum value of 𝑥 53
Variance
Variance
The Variance 𝝈𝟐𝑿 of Gaussian Distribution Function is given by:


1 2 Τ2𝜎 2
𝜎𝑋2 = න 𝑥 − 𝜇𝑋 2 𝑒 − 𝑥 − 𝜇 𝑑𝑥
2𝜋 𝜎2
−∞

Where

𝜎𝑋2 The Variance for Gaussian Distribution Function


𝜇𝑋 The Mean for Gaussian Distribution Function
𝑎 The minimum value of 𝑥
𝑏 The maximum value of 𝑥 54
Variance
Variance Formula
❖ Mathematically, the Variance 𝝈𝟐 of a Gaussian distribution
function is defined as the average of the squared deviations of the
random variable from its mean. That is mathematically given by:

σ 𝑥−𝜇 𝟐
𝟐
𝝈 =
𝑁
where
o 𝝈 is the standard deviation
o 𝝁 is the mean of the distribution
o 𝒙 is each individual data point
o 𝑵 is the total number of data points
o 𝚺 represents the sum of all the values in the numerator 55
Standard Deviation
Standard Deviation
What is Standard Deviation ?

❖ The formula for the standard deviation of a Gaussian distribution is


based on the idea of the spread of the data around the mean.

❖ Standard Deviation can be calculated mathematically as the


square root of the Variance 𝝈𝟐𝑿 .

57
Standard Deviation
How Standard Deviation can be Calculated?
It calculates the average distance of each data point from the
mean, by:

o Subtracting the mean from each data point (𝑥 − 𝜇)

o Squaring the differences (to ensure all values are positive) 𝑥 − 𝜇 𝟐

o Summing the squared differences σ 𝑥 − 𝜇 𝟐

σ 𝑥−𝜇 𝟐
o Dividing by the total number of data points
𝑁

o Finally, the square root is taken to convert the squared units back to the original
σ 𝑥−𝜇 𝟐
units of the data
𝑁
58
Standard Deviation
Standard Deviation Formula
Thus, Standard Deviation of the Gaussian Distribution Function is
calculated by the following Eq.:

σ 𝒙−𝝁 𝟐
𝝈= 𝝈𝟐 =
𝑵
where
o 𝝈 is the standard deviation
o 𝝁 is the mean of the distribution
o 𝒙 is each individual data point,
o 𝑵 is the total number of data points
o 𝚺 represents the sum of all the values in the numerator 59
Standard Deviation
Standard Deviation

In practice, this formula can be difficult to use when dealing with large
datasets or complex distributions, so statistical software such as Excel,
Matlab, R, or Python can be used to calculate the standard deviation of
a Gaussian distribution automatically.

60
Properties
Properties
Properties of PDF (Gaussian Distribution)

❖ Bell-shaped Curve, PDF is a Symmetric around the mean (μ).

❖ Peak at Mean: Maximum value occurs at 𝑥 = 𝜇.

❖ Total area under the Curve equals 1.

❖ Spread Determined by σ: Larger σ results in a wider curve.

❖ Integrated function, integration of PDF gives the CDF.

𝑭𝑿 𝒙 = න 𝒇𝑿 𝒙 𝒅𝒙
Properties
Properties of CDF (Gaussian Distribution)

❖ CDF always increases from 0 𝑡𝑜 1.

❖ Range of CDF, 𝐹(𝑥) ∈ [0, 1].

❖ Derivative Function, derivative of the CDF gives the PDF.

𝒅𝑭𝑿 𝒙
𝒇𝑿 𝒙 =
𝒅𝒙
Examples
Examples
Example 01
A certain variety of pine tree has a mean trunk diameter of 𝜇 = 150 cm, and a standard
deviation of 𝜎 = 30 𝑐𝑚, A certain section of a forest has 10000 of these trees.
a) How many of these trees may have a diameter smaller than 120 cm?
b) How many of these trees may have a diameter between 120 and 180 cm?

Solution:

? 65
Examples
Example 01
a) How many of these trees may have a diameter smaller than 120 cm?

Solution:

o = 50 – 34%
o About 16% of these trees have a diameter smaller than 120 cm
o That is 16% of 10000= 1600 trees
o About 1600 trees have a diameter smaller than 120 cm. 66
Examples
Example 01
a) How many of these trees may have a diameter between 120 and 180 cm?

Solution:

o 34%+34% =68% of these trees have a diameter between 120 and 180 cms.
o That is 68% of 10000= 6800 trees
o About 6800 trees have a diameter between 120 and 180 cms. 67
Examples
Example 02
The height of a plant species is normally distributed with a mean (𝝁) of
𝟏𝟎𝟎 𝒄𝒎 and a standard deviation (𝝈) 𝒐𝒇 𝟏𝟓 𝒄𝒎. What is the
probability that a randomly selected plant is taller than 115 𝑐𝑚?
Answer

? 68
Examples
Example 02

Answer
1. Convert to Z-Score:
𝑍 = (𝑋 − 𝜇) / 𝜎 = (115 − 100) / 15 = 1.0
2. Find the Cumulative Probability (𝑷(𝒁 ≤ 𝟏. 𝟎)):
From the Z-Table:
𝑃(𝑍 ≤ 1.0) = 0.8413.
3. Calculate the Probability (𝑷(𝒁 > 𝟏. 𝟎)):
𝑃 𝑍 > 1.0 = 1 − 𝑃 𝑍 ≤ 1.0
= 1 − 0.8413 = 0.1587.

Final Answer:
The probability that a randomly selected plant is taller than 115 cm is 15.87%. 69
Examples
Example 03
A student takes a standardized test where the scores are normally
distributed with a mean (μ) of 500 and a standard deviation (σ) of 100.
What is the probability that the student scores less than 650?
Answer:

Convert to Z-Score:
𝑍 = (𝑋 − 𝜇) / 𝜎 = (650 − 500) / 100 = 1.5

Find the Cumulative Probability (P(Z ≤ 1.5)):


From the Z-Table, 𝑃(𝑍 ≤ 1.5) = 0.9332.

Final Answer:
The probability that the student scores less than 650 is 93.32%.
70
Examples
Example 04
The weights of apples in a certain orchard are normally distributed with a mean (μ) of 200 grams and
a standard deviation (σ) of 20 grams. What is the probability that a randomly selected apple weighs
between 180 grams and 220 grams?
Answer:
1. Convert theValues to Z-Scores:
For X = 180: Z = (180 - 200) / 20 = -1.0
For X = 220: Z = (220 - 200) / 20 = 1.0

2. Find the Cumulative Probabilities:


P(Z ≤ -1.0) = 0.1587, P(Z ≤ 1.0) = 0.8413.

3. Calculate the Probability Between 180 and 220:


P(180 ≤ X ≤ 220) = P(Z ≤ 1.0) - P(Z ≤ -1.0) = 0.8413 - 0.1587 = 0.6826.
Final Answer:
The probability that a randomly selected apple weighs between 180 grams and 220 grams is 68.26%.
71
The End

Thank You

You might also like