Thursday, September 17, 2020

Binomial Probability Distribution (visualization using Seaborn)


Binomial Probability Distribution 

"pmf" is "Probability Mass Function" or "Probability Distribution". "rv" is "Random Variable".
Note: Binomial Distribution is a Discrete Distribution. Visualization of Binomial Distribution
Difference Between Normal and Binomial Distribution The main difference is that normal distribution is continous whereas binomial is discrete, but if there are enough data points it will be quite similar to normal distribution with certain loc and scale. We have code that produces overlapped "Normal" and "Binomial" distributions. We will show some of the best and some of the worst overlaps. number_of_trials = 150 for s in range(1000, 100000000, 1000000): print("size:", s) sns.distplot(random.binomial(n = number_of_trials, p=0.5, size=s), hist=False, label='binomial') sns.distplot(random.normal(loc = number_of_trials / 2, scale=5, size=s), hist=False, label='normal') plt.show() Best Overlaps
Worst Overlaps
References % numpy.org

No comments:

Post a Comment