Skip to content

Instantly share code, notes, and snippets.

@lucdangelis
Last active May 24, 2019 22:45
Show Gist options
  • Save lucdangelis/4bdb487dc34bc6f5d31ae2e990e629a2 to your computer and use it in GitHub Desktop.
Save lucdangelis/4bdb487dc34bc6f5d31ae2e990e629a2 to your computer and use it in GitHub Desktop.
gamma_shape = 9
gamma_scale = 0.5
for customer in range(0, 100):
distribution = poisson(np.random.gamma(shape=gamma_shape, scale=gamma_scale))
p_arr = []
for transactions in range(0,9):
p_arr.append(distribution.pmf(transactions))
plt.plot(p_arr, color='black', linewidth=0.7, zorder=1)
plt.ylabel('Probability')
plt.xlabel('Number of Transactions')
plt.xticks(range(0,9))
plt.title('Poisson Probability Distribution Curves 100 Customers')
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment