CommencerCommencer gratuitement

The more you toss, the more you learn

Imagine you are a frequentist (just for a day), and you've been tasked with estimating the probability of tossing heads with a (possibly biased) coin, but without observing any tosses. What would you say? It's impossible, there is no data! Then, you are allowed to flip the coin once. You get tails. What do you say now? Well, if that's all your data, you'd say the heads probability is 0%.

You can probably feel deep inside that these answers are not the best ones. But what would be better? What would a Bayesian say? Let's find out! numpy and seaborn have been imported for you as np and sns, respectively.

Cet exercice fait partie du cours

Bayesian Data Analysis in Python

Afficher le cours

Exercice interactif pratique

Essayez cet exercice en complétant cet exemple de code.

# Estimate and plot heads probability based on no data
heads_prob_nodata = ____
____(____, shade=True, label="no data")
plt.show()
Modifier et exécuter le code