Created
May 19, 2021 09:21
-
-
Save 18182324/0da29f885b947b5cb6c1e24580b79986 to your computer and use it in GitHub Desktop.
Deep L. Prob. Number of Dollar Signs
This file contains hidden or 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
#Solution for model assumption. Different number of dollar signs. | |
from scipy.stats import binom | |
#Define the considered numbers of dollar signs on the die (zero to six): | |
ndollar = np.asarray(np.linspace(0,6,7), dtype='int') | |
#Calculate corresponding probability of 2 $-signs in 10 throws | |
pdollar = binom.pmf(k=2, n=10, p=ndollar/6) | |
plt.stem(ndollar, pdollar) | |
plt.xlabel('Number of dollar signs on the dice') | |
plt.ylabel('Probability observing 2 dollar signs in 10 throws') | |
plt.title('Unnormalized likelihoods') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment