Skip to content
LeetQuant
F3 Probability and Bayesian Reasoning

F3 · Probability and Bayesian Reasoning · Lesson 4 of 4

Bayesian Updating with Repeated Evidence

Update beliefs through a stream of evidence with odds and likelihood ratios, and know when evidence can be multiplied and when it cannot.

18 min

Evidence adds up on the log-odds scale

The odds form of Bayes' theorem, from the earlier lesson, says posterior odds equal prior odds times the likelihood ratio. Its real power appears when evidence arrives in several pieces E1,…,EnE_1, \dots, E_n. If the pieces are conditionally independent given HH and given HcH^c, the likelihoods factor and

P(H∣E1,…,En)P(Hc∣E1,…,En)=P(H)P(Hc)∏i=1nΛi,Λi=P(Ei∣H)P(Ei∣Hc).\frac{P(H \mid E_1, \dots, E_n)}{P(H^c \mid E_1, \dots, E_n)} = \frac{P(H)}{P(H^c)} \prod_{i=1}^{n} \Lambda_i, \qquad \Lambda_i = \frac{P(E_i \mid H)}{P(E_i \mid H^c)} .

Taking logs turns the product into a sum:

log⁡posterior odds=log⁡prior odds+∑ilog⁡Λi.\log \text{posterior odds} = \log \text{prior odds} + \sum_i \log \Lambda_i .

Each observation contributes a fixed amount of evidence, measured for example in bits (log⁡2Λ\log_2 \Lambda). A head when comparing a double-headed coin to a fair one has Λ=2\Lambda = 2: exactly one bit. A prior of one in a million is about −20-20 bits, so it takes about 20 heads to reach even odds.

Three consequences:

  1. Sequential equals batch. Updating on E1E_1 and then using that posterior as the prior for E2E_2 gives the same answer as updating on both at once. Yesterday's posterior is today's prior.
  2. Order does not matter, since multiplication commutes.
  3. One impossible observation is decisive. If P(Ei∣H)=0P(E_i \mid H) = 0, the posterior of HH is 00 regardless of everything else. Conversely, a hypothesis given prior probability 00 can never recover, so do not assign 00 to anything you are not certain is impossible.

More than two hypotheses

With hypotheses H1,…,HkH_1, \dots, H_k, work with unnormalised weights:

P(Hj∣data)∝P(Hj)⋅P(data∣Hj).P(H_j \mid \text{data}) \propto P(H_j) \cdot P(\text{data} \mid H_j).

Multiply each prior by its likelihood, keep the ratios, and normalise only at the end. To predict the next observation, average the hypotheses' predictions with posterior weights (the posterior predictive):

P(Enext∣data)=∑jP(Enext∣Hj) P(Hj∣data).P(E_{\text{next}} \mid \text{data}) = \sum_j P(E_{\text{next}} \mid H_j)\, P(H_j \mid \text{data}).

Worked example

which die am I rolling?

A friend picks one of three fair dice at random: a 4-sided, a 6-sided and a 12-sided die. They roll it three times and report 3, then 2, then 5. Track the posterior after each roll, and find the probability the next roll is a 6.

Show solution

The likelihood of any particular face is 14\tfrac14, 16\tfrac16 or 112\tfrac1{12}, provided the face exists on that die. Start with weights 1:1:11 : 1 : 1 for (d4, d6, d12).

Roll 3. Multiply by 14:16:112\tfrac14 : \tfrac16 : \tfrac1{12}, i.e. by 3:2:13 : 2 : 1. Posterior 12,13,16\tfrac12, \tfrac13, \tfrac16.

Roll 2. Multiply by 3:2:13 : 2 : 1 again: weights 9:4:19 : 4 : 1, posterior 914,414,114\tfrac9{14}, \tfrac4{14}, \tfrac1{14}. Small numbers keep favouring the small die.

Roll 5. Impossible on the d4, so its weight drops to 00. The d6 and d12 weights multiply by 16:112=2:1\tfrac16 : \tfrac1{12} = 2 : 1, giving 0:8:10 : 8 : 1. Posterior: d6 with probability 89\tfrac89, d12 with 19\tfrac19.

Batch check. Over all three rolls the likelihoods are 00, (1/6)3(1/6)^3 and (1/12)3(1/12)^3, in ratio 0:8:10 : 8 : 1. Same answer, as it must be.

Prediction. A 6 is possible on the d6 and d12:

P(6 next)=89⋅16+19⋅112=16108+1108=17108≈0.157.P(6 \text{ next}) = \tfrac89 \cdot \tfrac16 + \tfrac19 \cdot \tfrac1{12} = \tfrac{16}{108} + \tfrac{1}{108} = \tfrac{17}{108} \approx 0.157 .

Note that the rolls are independent given the die but not unconditionally: each roll changes what you expect from the next. This is conditional independence at work.

Knowledge check

A hypothesis starts at prior odds 1:41 : 4. Three conditionally independent signals arrive with likelihood ratios 22, 33 and 12\tfrac12. What is the posterior probability of the hypothesis?

Independent and dependent evidence

The product rule needs conditional independence under each hypothesis. Two common failures:

  • Double counting. The same rumour reaching you through two brokers is one piece of evidence, not two. Given the truth, the second report is almost certain once you have heard the first, so its incremental likelihood ratio is close to 11.
  • Shared error mechanisms. A retest that fails for the same reason as the first test cannot independently confirm it.

The general rule replaces each Λi\Lambda_i with the incremental ratio given everything seen so far:

Λi=P(Ei∣H,E1,…,Ei−1)P(Ei∣Hc,E1,…,Ei−1).\Lambda_i = \frac{P(E_i \mid H, E_1, \dots, E_{i-1})}{P(E_i \mid H^c, E_1, \dots, E_{i-1})}.

This is always correct; independence is just the special case where the conditioning on earlier evidence drops out.

Worked example

a positive test, then a positive retest

A condition has prevalence 1%1\%. A test detects it 99%99\% of the time and gives a false positive in 5%5\% of healthy people. A patient tests positive twice.

(a) Find the posterior if the two results are conditionally independent given health status.

(b) Now suppose the false positives have a cause: 4%4\% of healthy people carry a cross-reacting antibody and always test positive, while the other 96%96\% test positive with probability 196\tfrac1{96} per test, independently. The per-test false-positive rate is still 0.04+0.96⋅196=5%0.04 + 0.96 \cdot \tfrac1{96} = 5\%. Find the posterior after two positives.

Show solution

Prior odds are 1:991 : 99. One positive has Λ=0.99/0.05=19.8\Lambda = 0.99 / 0.05 = 19.8, giving odds 19.8/99=0.219.8/99 = 0.2 and probability 16≈16.7%\tfrac16 \approx 16.7\%.

(a) Independent retest. Multiply by 19.819.8 again: odds 0.2×19.8=3.960.2 \times 19.8 = 3.96, probability 3.96/4.96≈79.8%3.96 / 4.96 \approx 79.8\%. Two positives are convincing.

(b) Shared cause. For a sick patient, P(++)=0.992=0.9801P(++) = 0.99^2 = 0.9801 as before. For a healthy patient,

P(++∣healthy)=0.04⋅1+0.96⋅(196)2≈0.0401,P(++ \mid \text{healthy}) = 0.04 \cdot 1 + 0.96 \cdot \Big(\tfrac{1}{96}\Big)^2 \approx 0.0401,

not 0.052=0.00250.05^2 = 0.0025. The two-test likelihood ratio is 0.9801/0.0401≈24.40.9801 / 0.0401 \approx 24.4 instead of 392392, so the posterior odds are 24.4/99≈0.24724.4 / 99 \approx 0.247 and the probability is about 19.8%19.8\%.

Incrementally: after one positive, a healthy patient is very likely an antibody carrier, so P(+2∣+1,healthy)=0.0401/0.05≈0.80P(+_2 \mid +_1, \text{healthy}) = 0.0401 / 0.05 \approx 0.80, while P(+2∣+1,sick)=0.99P(+_2 \mid +_1, \text{sick}) = 0.99. The retest's incremental ratio is only about 1.231.23. The second test barely moves the needle: confirmation needs a test that fails for different reasons.

Knowledge check

When is it valid to update on two pieces of evidence by multiplying the prior odds by each one's separate likelihood ratio?

From finitely many hypotheses to an unknown bias

If a coin's heads probability pp could be anything in [0,1][0, 1] with a uniform prior, the same recipe applies with an integral in place of a sum. After hh heads in nn flips the posterior density is proportional to ph(1−p)n−hp^h (1 - p)^{n - h}, a Beta(h+1,n−h+1)(h + 1, n - h + 1) distribution, and the posterior predictive probability of a head is

P(next head∣h of n)=∫01ph+1(1−p)n−h dp∫01ph(1−p)n−h dp=h+1n+2,P(\text{next head} \mid h \text{ of } n) = \frac{\int_0^1 p^{h+1}(1-p)^{n-h}\,dp}{\int_0^1 p^{h}(1-p)^{n-h}\,dp} = \frac{h + 1}{n + 2},

Laplace's rule of succession. It behaves the way the discrete examples do: evidence accumulates, the prior's pull (the "+1" and "+2") fades as nn grows, and the next flip is predicted by averaging over what the coin might be.

Knowledge check

A coin's heads probability is unknown, with a uniform prior on [0, 1]. It lands heads three times out of three. What is the probability the next flip is heads?

Approaching an updating question out loud

  1. List the hypotheses and priors, including the boring one ("it is just a fair coin").
  2. Write each likelihood for the observed data, watching for impossible observations.
  3. Check conditional independence; if it fails, use incremental likelihoods.
  4. Update in odds for two hypotheses, unnormalised weights for several, then normalise.
  5. Answer the question asked: a posterior probability, or a prediction averaged over the posterior.

Key takeaways

  • With conditionally independent evidence, log posterior odds = log prior odds + the sum of log likelihood ratios; order and batching do not matter.
  • For several hypotheses, multiply prior by likelihood, normalise last, and predict with the posterior-weighted average.
  • Dependent evidence needs incremental likelihood ratios; correlated errors can shrink a retest's value from a factor of about 20 to about 1.2.
  • Base rates are never erased, only outweighed; a zero likelihood or a zero prior is final.
  • Under a uniform prior on a coin's bias, P(next head)=(h+1)/(n+2)P(\text{next head}) = (h + 1)/(n + 2).

Practice problems

Finished reading?

Answer the 3 knowledge checks to complete this lesson (0 done).