The likelihood belongs to the hypothesis
How probable the observation is if the hypothesis is true. A hypothesis that makes the observation probable gains on one that makes it improbable, and neither number alone is the posterior.
Updating takes a prior over some hypotheses, multiplies each by how probable the observation is on it, and rescales so the results sum to 1. The Bayes factor compares how probable the data are on a hypothesis and on its rivals, and a second observation updates the result of the first.
Core ideas
The previous lesson computed one conditional credence from a table. Updating is the same computation arranged so that it can be repeated as evidence keeps arriving.
How probable the observation is if the hypothesis is true. A hypothesis that makes the observation probable gains on one that makes it improbable, and neither number alone is the posterior.
The likelihood of the data on a hypothesis divided by its likelihood on the alternatives. A factor of 3 means the data are three times as probable on the hypothesis, and it multiplies the odds.
The posterior after the first observation is the prior for the second. The factors of independent observations multiply, and the order in which they arrive does not change the result.
The material
A prior, a likelihood and an observation, worked out on paper before the lab does it.
Two urns hold four balls each. One of them is chosen by a fair coin, you cannot see which, and a ball is drawn from it.
The prior credence in each urn is 1/2. A red ball is drawn. It is red with probability 3/4 if the urn is urn 1 and 1/4 if it is urn 2. Multiply each prior by its likelihood, then divide by the total so that the posteriors sum to 1.
The posterior credence in a hypothesis H after evidence E is P(H | E) = P(E | H)·P(H) / P(E). The denominator P(E) is the total of the products over every hypothesis, so the step is: multiply, add, divide.
The red draw moved urn 1 from 1/2 to 3/4. A summary of how much it moved, independent of where it started, is the Bayes factor: the probability of the data on urn 1, 3/4, over the probability of the data on the alternatives, 1/4, which is 3.
The Bayes factor of the data for H is P(E | H) / P(E | ¬H), with the likelihood on the alternatives averaged by their priors when there are several. The odds on H are the credence in H against the credence in ¬H, so a credence of 3/4 is odds of 3 to 1, and odds of a to b are a credence of a/(a + b). The posterior odds on H equal the prior odds times the factor, and a factor of 1 leaves the credence where it was.
Here the prior odds are 1 to 1, the factor is 3, and the posterior odds are 3 to 1, which is the posterior 3/4. With two hypotheses the factor does not depend on the prior, so the same red ball multiplies the odds by 3 whatever they were.
Put the ball back and draw again. The second ball is also red. The prior for this step is the previous posterior, 3/4 for urn 1, and the update gives (3/4)·(3/4) = 9/16 against (1/4)·(1/4) = 1/16, so the posterior is 9/10. The factors multiply, 3 · 3 = 9, and so do the odds, 1 to 1, then 3 to 1, then 9 to 1. Had the second ball been blue, the factor for urn 1 would have been 1/3 and the credence would have returned to 1/2; the same two balls in the other order give the same answer.
A coin is either two-headed or fair, and the prior for two-headed is 1/100. Three heads in a row are certain on the two-headed coin and have probability 1/8 on the fair one. That is a Bayes factor of 8, and the lab gives a posterior of 8/107 for two-headed: under 8%.
The evidence confirms the hypothesis, in that its credence rose from 1/100, and fits it perfectly, since its likelihood is 1. It does not prove it. A posterior of 1 would need the data to be impossible on every rival, and a rival that makes three heads merely improbable keeps its share of the credence. The reverse is stricter: one tails makes the likelihood of the two-headed coin 0 and its posterior 0, whatever the prior.
What the lab cannot supply is the hypotheses. It updates over the ones listed, with the likelihoods typed in, and if the truth is not among them it still prints exact fractions.
Interactive
prior times likelihood, normalised; the Bayes factor is the weight of the data
Method
Five moves, the same whether there are two hypotheses or five.
The priors must sum to 1, and the list must include the truth if the answer is to be trusted.
For each hypothesis, how probable the observation is if it is true. A likelihood is not a credence in the hypothesis.
Multiply each prior by its likelihood, add the products, and divide each product by the total. The results are the posteriors.
Divide the likelihood on the hypothesis by the likelihood on the rest. It says how much the observation moved the odds, without the prior in it.
For another observation, repeat the steps from the posterior. Do not return to the original prior and do not count an observation twice.
Prior 1/2 each; urn 1 has 3 red in 4, urn 2 has 1 red in 4.
The same answer comes from one step using both balls: the likelihood of two reds is 9/16 on urn 1 and 1/16 on urn 2, a factor of 9 on prior odds of 1 to 1. Updating twice and updating once are the same arithmetic.
You should be able to take priors and likelihoods, produce posteriors by multiplying, adding and dividing, state the Bayes factor of the data for a hypothesis, and update again on a second observation, showing that the factors multiply.
Something to change about this lesson? Write it down, tick it off when it is handled, and export the list when you want to act on it. Kept in this browser only: nothing is sent anywhere, and nobody is notified.
No recommendations yet for this lesson.