Normal Distribution

Normal Distribution

What is it ?

It's one of the most popular forms of distribution in statistics also known as Gaussian, Gauss or Laplace-Gauss distribution), curved like a bell, hence the name of bell curve.

The Gaussian distribution is defined by 2 parameters σ (the standard deviation of the distribution) and μ (the mean of the distribution).

Characteristics of normal distribution :

  • The majority of the data is centered around the mean.
  • The mean determine the location of the distribution and the standard deviation determines how flat and wide the distribution is.
  • Normal distribution is symmetric ; the area on the left is equal to the area on the right.
  • The mean is equal to the mode and it's equal to the median.
  • The area under the curve is equal to 1
  • The law of 68.3,95,99.7 : 68% pf the events are in the middle(1 std from the mean),95% of the events are 2std away from the mean and finnaly 99.7% pf the events are away from the mean.

Laplace-Gauss distribution PDF :

normal distribution, gauss, data science, statistics, walid soula

  • f(x) : probability density function
  • σ : standard deviation
  • μ = mean

This formula allows us to draw our normal distribution using the mean and the standard deviation. For example X~N(10,2) ; 10 is the mean and 2 is the standard deviation

Our normal distribution would be equal to :

normal distribution, gauss, data science, statistics, walid soula
Let's take an example to see where do we use it

Example :

No alt text provided for this image

Photo by Philip Myrtorp on Unsplash

You have a business appointment to schedule, however you don't know the time when you should set the appointment, taking into account that you must take a plane and then a taxi to attend the appointment.

You know that flying from point A to B provides the following distribution:

normal distribution, gauss, data science, statistics, walid soula

From the distribution, you know that it is most likely that the time needed to reach your destination would be between 3.5h to 4.5h with most likely the flight would be at 4 hours, basing on the flights flown. ,and that you have a low chance of arriving in 2.5 or 5 hours and more, so you decide to schedule your appointment at 4.5 hours after your shift so as not to arrive late!

You can see in the graph that the average is 4 hours with an approximate standard deviation (σ) of 0.5 hours.

In the next article we will explore the standard normal distribution as well as how to determine the probabilities, what would be the chances that the trip would only take 3 hours? ??

Let's build it on Python

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

# PDF

# We need x , mu and sigma for normal distribution


def normal_dis_pdf(x, mu, sigma):
? ? return (1 / (sigma * np.sqrt(2 * np.pi))) * np.exp((-1 / 2)* ((x- mu / sigma) ** 2))


# Let's test it
# x will be a np.array, you can also do it with a single value
# μ would be 0 and σ is equal to 1


x = np.array([1,2,3])


# You can also just do , no need to hard code
norm.pdf(x,loc=0,scale=1)


norm.pdf(x)
# By default loc is equal to 0 and scale is equal to 1


# Let's do some visualization
# We will have values that start from -7 to 7 with 10000 values


x = np.linspace(-7,7,10000)


fig, ax = plt.subplots(figsize=(20,8))
ax.plot(x,normal_dis_pdf(x,0,1))
plt.show()

# CDF

norm.cdf(x,loc=0,scale=1)


fig, ax = plt.subplots(figsize=(20,8))
ax.plot(x,norm.cdf(x,0,1))
plt.show()        

要查看或添加评论,请登录

Dr. Oualid S.的更多文章

  • Building Recommendation engines using ALS

    Building Recommendation engines using ALS

    In this article, I will cover how to build a recommendation engine using ALS, illustrated by three different examples…

    1 条评论
  • Van Westendorp’s Price Sensitivity Meter (PSM)

    Van Westendorp’s Price Sensitivity Meter (PSM)

    In this article related to the price Strategies in the series of International Marketing I will cover the Van…

    3 条评论
  • Herfindahl-Hirschman Index (HHI)

    Herfindahl-Hirschman Index (HHI)

    In this article, I will discuss a key metric in market research known as the Herfindahl-Hirschman Index (HHI), which is…

  • Evaluating a company’s portfolio with the MABA Analysis

    Evaluating a company’s portfolio with the MABA Analysis

    In this article, we will cover another tool that can be used in international marketing called MABA Analysis. This tool…

  • 7S McKinsey Model for Internal Analysis

    7S McKinsey Model for Internal Analysis

    It's been quite a while since I wrote an article on business strategies, so I thought I'd kick off this week by…

    2 条评论
  • Step by Step guide A/B for UX (Binary Data)

    Step by Step guide A/B for UX (Binary Data)

    In the last article I covered how to execute a hypothesis test illustrated by a UX research design where we compared…

  • Retail Analytics project

    Retail Analytics project

    This article is an introduction to the world of machine learning, for anyone wanting to participate in small-scale…

  • From Sci-Fi to Reality | Exploring the root of AI

    From Sci-Fi to Reality | Exploring the root of AI

    For people who have not jumped into AI or are just hooked on generative AI and want to understand how things work?…

  • Apache Airflow Building End To End ETL Project

    Apache Airflow Building End To End ETL Project

    In that article I will cover the essential that you need to know about Airflow, if you don’t know what it is, I wrote…

  • Diving Deep into Significance Analysis

    Diving Deep into Significance Analysis

    In the constantly changing landscape of scientific research, the pursuit of significance extends well beyond the usual…

社区洞察

其他会员也浏览了