Chapter 10. Testing
In “The Euro Problem” I presented a problem from David MacKay’s book, Information Theory, Inference, and Learning Algorithms:
A statistical statement appeared in The Guardian on Friday, January 4, 2002:
When spun on edge 250 times, a Belgian one-euro coin came up heads 140 times and tails 110. “It looks very suspicious to me,” said Barry Blight, a statistics lecturer at the London School of Economics. “If the coin were unbiased, the chance of getting a result as extreme as that would be less than 7%.”
But do these data give evidence that the coin is biased rather than fair?
We started to answer this question in Chapter 4; to review, our answer was based on these modeling decisions:
-
If you spin a coin on edge, there is some probability, , that it will land heads up.
-
The value of varies from one coin to the next, depending on how the coin is balanced and possibly other factors.
Starting with a uniform prior distribution for , we updated it with the given data, 140 heads and 110 tails. Then we used the posterior distribution to compute the most likely value of , the posterior mean, and a credible interval.
But we never really answered MacKay’s question: “Do these data give evidence that the coin is biased rather than fair?”
In this chapter, finally, we will.
Estimation
Let’s review the solution to the Euro Problem from “The Binomial Likelihood Function”. We started with a uniform prior:
import
numpy
as
np
from
empiricaldist
import
Pmf
xs
Get Think Bayes, 2nd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.