Normal Probability Plot (original) (raw)

`# imports import numpy as np import matplotlib.pyplot as plt import seaborn as sns import scipy.stats as sc import statsmodels.graphics.gofplots as sm

define distributions

sample_size = 10000 standard_norm = np.random.normal(size=sample_size) heavy_tailed_norm = np.random.normal(loc=0, scale=2, size=sample_size) skewed_norm = sc.skewnorm.rvs(a=5, size=sample_size) skew_left_norm = sc.skewnorm.rvs(a=-5, size=sample_size)

plots for standard distribution

fig, ax = plt.subplots(1, 2, figsize=(12, 7)) sns.histplot(standard_norm,kde=True, color ='blue',ax=ax[0]) sm.ProbPlot(standard_norm).qqplot(line='s', ax=ax[1])

plot for right-tailed distribution

fig, ax = plt.subplots(1, 2, figsize=(12, 7)) sm.ProbPlot(skewed_norm).qqplot(line='s', ax=ax[1]); sns.histplot(skewed_norm,kde=True, color ='blue',ax=ax[0])

plot for left-tailed distribution

fig, ax = plt.subplots(1, 2, figsize=(12, 7)) sm.ProbPlot(skew_left_norm).qqplot(line='s',color='red', ax=ax[1]); sns.histplot(skew_left_norm,kde=True, color ='red',ax=ax[0])

plot for heavy tailed distribution

fig, ax = plt.subplots(1, 2, figsize=(12, 7)) sm.ProbPlot(heavy_tailed_norm).qqplot(line='s',color ='green', ax=ax[1]); sns.histplot(heavy_tailed_norm,kde=True, color ='green',ax=ax[0]) sns.histplot(standard_norm,kde=True, color ='red',ax=ax[0])

`