Overview

2 Priors, likelihoods, and posteriors—What Bayes is all about: Combining intuition and data to update our knowledge

Bayesian reasoning is presented as a natural way to combine what we already believe with what we observe, producing an updated belief called the posterior. The chapter explains Bayes’ theorem as the rule that connects these pieces: a prior captures initial belief, a likelihood measures how well each hypothesis explains the data, and the evidence normalizes the result so all posterior probabilities sum to one. Through simple examples like rain, clouds, and a rare medical test, the chapter shows that Bayesian updating answers a practical question: how should we change our minds when new information arrives?

The chapter then builds intuition for the mechanics of Bayes’ theorem by working through competing hypotheses and showing how priors and likelihoods interact. A hypothesis with a strong prior can still be weakened by poor support from the data, while a hypothesis with a modest prior can become plausible if it fits the evidence well. The text also highlights important edge cases: assigning zero probability to a hypothesis makes it impossible to recover later, and data with zero likelihood rules a hypothesis out entirely. This logic is compared to detective-style elimination, where accumulating evidence narrows the field of suspects.

To make the ideas concrete, the chapter develops a full model for estimating whether people prefer tea or coffee. It defines a discrete set of possible proportions, chooses a prior distribution over those values, and derives the likelihood using the binomial distribution for survey results such as three tea drinkers out of five. Applying Bayes’ theorem yields a posterior that peaks near the observed sample proportion while still expressing uncertainty, especially with small datasets. The chapter closes by showing that larger datasets sharpen the posterior and that reasonable priors usually matter less as evidence grows, as long as they do not rule out plausible answers too early.

Bayes’ theorem and the interpretation of its components.
An example of the Bayesian procedure to update prior probabilities of three hypotheses to their posterior probabilities.
Prior and posterior probability distributions of 𝑝, the proportion of tea drinkers.
Comparison between the prior and posterior distributions of 𝑝 under different datasets. As the size of the dataset grows, the most-likely prediction of 𝑝 becomes more confident.
Comparison between the posterior distributions of 𝑝 under different prior distributions.
Comparison between the posterior distributions of 𝑝 under different prior distributions and a large sample size. Most prior distributions converge to similar-looking posteriors under a lot of data.

Summary

  • Bayesian probability models our belief about an unknown quantity using a set of competing hypotheses, each corresponding to a value that the quantity of interest can take. The probability of a hypothesis quantifies how likely we believe it is for the quantity to take that value.
  • Bayes’ theorem states that the posterior probability is proportional to the product of the corresponding prior and likelihood.
  • Multiplying the corresponding prior and likelihood yields the unnormalized posterior probability. We normalize these probabilities so that they sum to 1 to obtain the true posterior probabilities.
  • The Bayesian update rule models a detective’s search for a culprit of a crime: the detective updates the probability that each suspect committed the crime based on the evidence that the detective uncovers.
  • The choice of the prior distribution in a Bayesian model reflects your belief about the quantity of interest and is subjective.
  • The likelihood is the probability of the data under each hypothesis and thus quantifies how well a hypothesis explains the data.
  • The posterior distribution in a Bayesian model reflects both the prior and the data.
  • A hypothesis that has a zero prior probability (when we rule out the hypothesis initially) or a zero likelihood (when the data rules out the hypothesis) is guaranteed to have a zero posterior probability.
  • Under a lot of data, many priors lead to similar posteriors.

FAQ

What is Bayes’ theorem used for in Bayesian inference?Bayes’ theorem is used to update our belief about a hypothesis after observing data. It combines the prior belief and the likelihood of the data to produce the posterior probability, which represents the updated belief.
What is the difference between a prior and a posterior?A prior is the probability we assign to a hypothesis before seeing new data. A posterior is the updated probability of that hypothesis after we observe data and apply Bayes’ theorem.
What does the likelihood represent in a Bayesian model?The likelihood measures how well a hypothesis explains the observed data. It is the probability of the data given the hypothesis, written as Pr(D | hypothesis).
What is the evidence in Bayes’ theorem?The evidence, Pr(D), is the normalizing constant in Bayes’ theorem. It ensures that all posterior probabilities add up to 1 and is equal to the sum of all unnormalized posterior terms across hypotheses.
Why do we multiply the prior by the likelihood?Multiplying the prior by the likelihood gives the unnormalized posterior. This combines what we believed before with how well each hypothesis explains the observed data.
How does Bayes’ theorem update a belief about rain after seeing dark clouds?If the prior belief says rain is unlikely, but dark clouds are much more likely on rainy days than on dry days, Bayes’ theorem increases the probability of rain. However, a strong prior against rain can still keep no-rain as the most likely outcome.
Why can a rare disease still have a low probability after a positive test?Because if the disease is rare and the test has a notable false positive rate, many positive results can come from people who do not have the disease. Bayes’ theorem accounts for the rarity of the disease and prevents overestimating the chance of illness based only on a positive result.
What is the binomial likelihood in the tea-vs-coffee example?The binomial likelihood gives the probability of observing a certain number of tea-preferring people out of a fixed number surveyed. It is based on the number of successes, the total number of trials, and the hypothesized proportion p.
How does sample size affect the posterior distribution?As sample size increases, the posterior becomes more concentrated around the most plausible value. More data usually means less uncertainty and a stronger belief in the best-supported hypothesis.
Why should a prior avoid assigning zero probability to plausible hypotheses?If a plausible hypothesis gets zero prior probability, no amount of data can revive it, because its posterior will always remain zero. This can wrongly eliminate the true explanation before the data has a chance to support it.

pro $24.99 per month

  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose one free eBook per month to keep
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime

lite $19.99 per month

  • access to all Manning books, including MEAPs!

team

5, 10 or 20 seats+ for your team - learn more


choose your plan

team

monthly
annual
$49.99
$499.99
only $41.67 per month
  • five seats for your team
  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose another free product every time you renew
  • choose twelve free products per year
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime
  • renews annually, pause or cancel renewal anytime
  • Grokking Bayes ebook for free
choose your plan

team

monthly
annual
$49.99
$499.99
only $41.67 per month
  • five seats for your team
  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose another free product every time you renew
  • choose twelve free products per year
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime
  • renews annually, pause or cancel renewal anytime
  • Grokking Bayes ebook for free