The Reverend Bayes and Laplace
Thomas Bayes (c. 1701–1761) was minister of a Nonconformist congregation in Tunbridge Wells in Kent and an amateur mathematician. After his death his friend Richard Price found a manuscript among his papers and had it printed in the Royal Society’s Philosophical Transactions in 1763 under the title An Essay towards solving a Problem in the Doctrine of Chances. Bayes asked: if an event has occurred $h$ times and failed $t$ times, what can we say about its unknown probability? Independently of him, Pierre-Simon Laplace from 1774 developed “inverse probability” into a general tool, using it among other things to show that more boys than girls are born in Paris and to estimate the uncertainty in the masses of the planets.
The theorem
From the definition of conditional probability, $P(A \cap B) = P(A)\,P(B\,|\,A) = P(B)\,P(A\,|\,B)$. Divide by $P(B)$:
Think of $A$ as a hypothesis and $B$ as data. Then
- $P(A)$ – the prior probability: what we believed before the data;
- $P(B\,|\,A)$ – the likelihood: how well the hypothesis predicts the data we saw;
- $P(A\,|\,B)$ – the posterior probability: what we ought to believe afterwards.
The theorem is pure mathematics and entirely uncontroversial. The 20th-century debate between “Bayesians” and “frequentists” was about whether one may assign a probability to a hypothesis at all – and where the prior should come from.
The positive test
A disease has a prevalence of 1 %. A test detects 90 % of the ill (the sensitivity) and is negative in 91 % of the healthy (the specificity). You test positive. How likely is it that you are ill? When the psychologist Gerd Gigerenzer put exactly this question to 160 gynaecologists, almost half answered “9 in 10”, and only about one in five chose the correct answer: about 1 in 10.
The odds form – the easiest version
Write probabilities as odds, $O = P/(1-P)$. Then Bayes’ theorem becomes a simple multiplication:
The fraction is the likelihood ratio: how many times more probable the data are if the hypothesis is true than if it is false. For the test above it is $0.90/0.09 = 10$. The prior odds are 1 : 99; the posterior odds are 10 : 99, i.e. a probability of $10/109 \approx 9\ \%$. Each new independent observation simply multiplies the odds by its likelihood ratio. Alan Turing and I.J. Good used precisely this form, measured in logarithmic units (“decibans”), to break the German Enigma code at Bletchley Park during the Second World War.
The Monty Hall problem
In an American TV game show, Let’s Make a Deal hosted by Monty Hall, you must choose one of three doors. Behind one is a car, behind the other two a goat. When you have chosen, the host – who knows where the car is – opens one of the other doors and reveals a goat. He offers you the chance to switch. Should you? When Marilyn vos Savant wrote in Parade magazine in 1990 that you should switch, she received thousands of letters, including from mathematicians who thought she was wrong. She was right: switching wins with probability $2/3$.
Bayesian updating – how biased is the coin?
Bayes’ original problem: a coin shows tails with an unknown probability $p$. We describe our uncertainty about $p$ by a distribution. After $h$ tails and $t$ heads the posterior distribution is proportional to the prior times the likelihood $p^h(1-p)^t$. Starting from a beta distribution $\text{Beta}(a,b)$, one ends with $\text{Beta}(a+h,\,b+t)$. With a uniform prior ($a = b = 1$) the best estimate for the next toss is Laplace’s rule of succession $(h+1)/(n+2)$.
The prosecutor’s fallacy
Confusing $P(\text{data}\,|\,\text{innocent})$ with $P(\text{innocent}\,|\,\text{data})$ is called the prosecutor’s fallacy. If a DNA trace matches one in a million, and the city has five million inhabitants, about five innocent people will also match – so a match alone does not make the probability of guilt 999,999 in a million. In the British case against Sally Clark (convicted in 1999, acquitted on appeal in 2003) an expert witness stated that the probability of two cot deaths in the same family was 1 in 73 million. The figure was wrongly calculated (it assumed independence), and it was presented as if it were the probability that she was innocent. The Royal Statistical Society protested publicly in 2001.
Bayes in practice
Spam filters
A filter learns how often each word appears in spam and in ordinary mail, and combines the words’ likelihood ratios into a probability of spam. Paul Graham popularised the method in 2002.
Search
The submarine USS Scorpion (1968) and the wreck of Air France flight 447, which crashed into the Atlantic in 2009, were found by Bayesian search: the seabed is divided into cells with a probability of containing the wreck, updated each time a cell is searched without success. AF447 was found in April 2011 after a new analysis.
Physics and astronomy
The masses of the black holes behind gravitational waves, the cosmological parameters from the Planck satellite and the orbits of exoplanets are determined with Bayesian methods, computing the whole distribution of parameter values consistent with the data.
The brain
An influential theory in neuroscience holds that the senses work in a Bayesian way: the brain combines expectation (prior) with sensory input (likelihood). Many optical illusions can be explained like this – for instance our assumption that light comes from above.
Further reading
- Sharon Bertsch McGrayne: The Theory That Would Not Die (Yale 2011) – the history of Bayes’ theorem from Enigma to submarine hunting
- Gerd Gigerenzer: Reckoning with Risk (Penguin 2003)
- David Spiegelhalter: The Art of Statistics (Pelican 2019)
- E.T. Jaynes: Probability Theory – The Logic of Science (Cambridge 2003) – for the mathematically inclined
- The pages on contingency tables and tree diagrams and probability