Normal Distribution:(Python)


Normal distribution: Normal Distribution also known as Gaussian distribution; is a continuous probabilistic distribution with data being symmetrically distributed on the either side of mean. Normal distribution is one of the most commonly used distributions while studying stock market data or any other statistical analysis.

Properties of Normal Distribution:

  1. The mean, median, and mode are equal.
  2. The normal curve is bell-shaped and is symmetric about the mean.
  3. The total area under the curve is equal to one.
  4. The normal curve approaches, but never touches, the x-axis.
  5. Skewness which is measure of dissymmetry in the probability distribution is equal to zero
  6. Kurtosis, a measure of whether the data is heavy-tailed or light-tailed relative to a normal distribution is equal to 3
  7. Between µ − σ and µ + σ the graph is concave down and elsewhere the graph is concave up. The points at which the graph changes concavity are called inflection points.

Normal Distribution curve can completely be described with the help mean and standard deviation. So if we know two important parameters (mean and standard deviation) we could study all the properties of normal distribution.

For a normal distribution, 68% of the observations are within +/- one standard deviation of the mean, 95% are within +/- two standard deviations, and 99.7% are within +- three standard deviations.

Equation of Normal Distribution:

The Standard Normal Distribution:

The standard normal distribution is a special case of normal distribution with mean equal to zero and standard deviation is equal to 1.


Normal Distribution Curve using Python:

To generate normal distribution curve; we would use two very common libraries in Python:

  1. Scipy: Scipy is an open source python library used for scientific computing.
  2. Seaborn: Seaborn is a Python statistical data visualization library based on matplotlib. It provides a high-level interface for drawing attractive and informative statistical graphics.
  3. norm.rvs: norm.rvs generates normal distribution
    1. Loc: loc option specifies the mean of the distribution
    2. Scale: scale option specifies the standard deviation of the distribution

Below is the code used:

from scipy.stats import norm

norm_data = norm.rvs(size = 10000 , loc = 0 , scale = 1 , random_state = None)

import seaborn as sns

ax = sns.distplot(norm_data,  bins=100,  kde=False,  color=’skyblue’,  hist_kws={“linewidth”: 15,’alpha’:1})

ax.set(xlabel=’Normal’, ylabel=’Frequency’)



Please enter your comment!
Please enter your name here