A coin, three ways
A coin has some bias — a probability θ of landing heads — and we do not know what it is. Toss it, write down what happened, and then reason about it three times over: with a classical test, with maximum likelihood, and with Bayes. The tosses below belong to all three tabs, so what changes between them is the method and nothing else.
Put a hypothesis about the coin on trial. The hypothesis has to say how often the coin lands heads — its P(heads): a fair coin is 0.5, a two-headed one is 1. If the coin really did land heads that often, how surprising would the tosses we have be? That is the p-value, and if it falls below α the hypothesis is rejected.
Take the bias that makes these tosses likeliest, which for a coin is the share of heads. The line across the curve is 1.92 log-units below its peak, and everything above that line is the likelihood-ratio interval. That share of heads is the best estimate of P(heads), written θ̂, and the Wald interval — θ̂ ± 1.96 √(θ̂(1 − θ̂)/n) — is drawn beside it.
likelihood-ratio interval Wald interval θ̂
A prior says what we think of the coin before any toss; the posterior is the prior and the likelihood multiplied together and normalised.
The prior
likelihood: how likely is the observation
The posterior
posterior the prior, for comparison posterior mean
A coin whose bias we get to choose, tossed as many times as we like. The seed makes the tosses repeatable, so a whole class can work on the same string.
the same tosses, three answers