Last active
February 28, 2022 18:31
-
-
Save lucdangelis/28cb61ac540387f0abcceb7d3b09bf4b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import matplotlib.pyplot as plt | |
from scipy.stats import poisson,expon,nbinom | |
poisson_lambda = 4.3 | |
p_arr = [] | |
distribution = poisson(poisson_lambda) | |
for transactions in range(0,10): | |
p_arr.append(distribution.pmf(transactions)) | |
plt.ylabel('Probability') | |
plt.xlabel('Number of Transactions') | |
plt.xticks(range(0, 10)) | |
plt.title('Poisson Probability Mass Function') | |
plt.plot(p_arr, color='black', linewidth=0.7, zorder=1) | |
plt.scatter(range(0, 10), p_arr, color='purple', edgecolor='black', linewidth=0.7, zorder=2) | |
display(plt.show()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment