Think Bayes Estimating Proportions
Over the next several days, I will be using examples from the book, "Think Bayes: Bayesian Statistics in Python" by Allen Downey. This book provides an introduction to Bayesian statistics using the Python programming language. It begins with problems like the Monty Hall problem:
But Downey moves on to more analytic techniques. For example, he introduces the Euro Problem which was described in "Information Theory, Inference, and Learning Algorithms" by David MacKay.
Someone spun a Euro coin on edge 250 times. These 250 spins resulted in heads 140 times and tails 110 times. A statistician claimed these results were suspicious of an unbalanced coin. "But", Downey asks, "do these data give evidence that the coin is biased rather than fair?"
领英推荐
Spinning (or flipping) a fair coin is an example of a Bernoulli process. Google will give you a good definition; for my purposes, I will assume you understand a fair coin. But we are "uncertain" that the coin is fair.
To perform Bayesian inference, Downey proposes a set of prior hypotheses or beliefs that the fraction of heads that we see ranges uniformly from from 0 to 1. This proposed prior is called uninformative because all possibilities have an equal probability. As a second step, Downey creates a set of 100 equally-spaced likelihoods ranging from 0 to 100 in steps of 1. Finally, he creates a set of data consisting of 140 "heads" and 110 "tails".
He calculates the posterior belief by multiplying each hypothesis by the likelihood of the data and then normalizing the posterior belief so that the sum of all posterior beliefs is 1 (a law of probabilities). The result is that our belief of the "bias" of this coin is almost certainly between 40 and 70% and most likely between 50% and 60% (the most likely value is about 56%).
However, he does not answer MacKay's original question. He leaves us hanging and promises an answer later (in chapter 10). You'll either need to come back on read the book yourself for the answer.