Overview

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

Bayesian probability provides a formal way to combine what we already believe with what we observe, producing an updated belief called the posterior. The chapter frames this as a general method for reasoning under uncertainty: begin with a set of possible hypotheses, assign each one a prior probability, then use new data to revise those probabilities. Bayes’ theorem is the rule that makes this update possible, answering the central question of how much we should change our minds after seeing evidence.

The key pieces of the update are the prior, the likelihood, and the posterior, with the evidence acting as the normalizing factor that makes the final probabilities sum to one. The prior represents our initial belief before seeing data, while the likelihood measures how well each hypothesis explains the observed evidence. Multiplying prior and likelihood gives an unnormalized posterior, and dividing by the evidence yields the final posterior distribution. Through examples such as weather prediction and rare disease testing, the chapter shows how strong priors and imperfect tests can produce surprising but sensible results, and how zero likelihood or zero prior can eliminate a hypothesis entirely.

The chapter then builds a full Bayesian model for a tea-versus-coffee preference survey, treating the unknown preference rate as a discrete set of hypotheses. A prior distribution is assigned over possible values, and the likelihood is derived from a binomial model that accounts for both the number of tea drinkers and the number of ways they could be arranged in the sample. After updating, the posterior concentrates around the most plausible proportion while still representing uncertainty, and the chapter illustrates how more data makes the posterior sharper and how different priors can influence early conclusions. Over time, reasonable priors tend to lead to similar results when enough data is available, which highlights Bayesian updating as an iterative process where each posterior becomes the next prior.

Bayes’ theorem and the interpretation of its components.
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.
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.
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 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.
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.
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 the probability of a hypothesis after observing data. It combines the prior belief and the likelihood of the observed data to produce the posterior, which represents the updated belief.
What do the prior, likelihood, posterior, and evidence represent?The prior is the initial belief about a hypothesis. The likelihood measures how well the hypothesis explains the observed data. The posterior is the updated belief after seeing the data. The evidence is the normalizing constant that makes the posterior probabilities sum to 1.
Why is the posterior proportional to the prior times the likelihood?Because Bayes’ theorem says the posterior equals the prior multiplied by the likelihood, divided by the evidence. Since the evidence is the same for all hypotheses, the posterior is proportional to prior × likelihood.
What is the difference between a prior probability and a likelihood?A prior probability describes how much you believe a hypothesis before seeing data. A likelihood describes how probable the observed data is if that hypothesis were true.
Why do posterior probabilities need to be normalized?Normalization ensures the posterior forms a valid probability distribution, meaning all posterior probabilities add up to 1.
How does Bayes’ theorem explain the rain example with dark clouds?In the rain example, the prior says rain is unlikely, but the dark cloud data has a much higher likelihood if it is raining. Bayes’ theorem combines these to increase the probability of rain, while still allowing no rain to remain the more likely outcome if the prior strongly favored it.
Why can a positive medical test still mean a disease is unlikely?Because if the disease is rare, the prior probability is very small. Even with a positive test, false positives may outweigh true positives, so the posterior probability of having the disease can still be low.
What is the base-rate fallacy?The base-rate fallacy is the mistake of ignoring how rare or common something is before seeing the evidence. In Bayesian terms, it means neglecting the prior probability when interpreting the posterior.
How is the likelihood computed in the tea vs. coffee example?The likelihood is modeled with a binomial distribution. For 3 tea drinkers out of 5 surveyed, it is computed as (5 choose 3) p^3 (1-p)^2, where p is the proportion of tea lovers.
How do priors affect the posterior, especially when data is limited?When data is limited, the prior can strongly influence the posterior. Different priors may lead to noticeably different conclusions. As more data is collected, reasonable priors usually lead to similar posteriors, unless a prior assigns zero probability to the true hypothesis.

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


Close
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 Grokking Bayes ebook for free
Close
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 Grokking Bayes ebook for free