Bayes' rule and prior predictive models
Construct a joint model, normalize its posterior, and check what the prior predicts before fitting observations.
On this page
The question for today
What you’ll understand
- Distinguish a likelihood from a posterior density.
- Compute posterior probabilities from a finite joint model.
- Use prior predictive implications to question modeling assumptions.
Bayesian inference starts by declaring a joint probability model for unknown quantities and observations. It does not turn an arbitrary score into a probability merely by calling that score a likelihood. Imagine a component whose failure probability is unknown. A distribution over that probability describes uncertainty about the component; a conditional distribution describes the observations produced at a specified probability. Bayes' rule connects these two layers after data arrive. The connection is exact within the declared model, while the model itself remains open to criticism.
The joint distribution comes first
Write the unknown parameter as and observations as . A proper prior integrates to one over its declared support, and the sampling distribution integrates or sums to one over possible observations for each parameter. Their product defines the joint distribution. A likelihood holds the observed data fixed and varies the parameter; it generally does not integrate to one over that parameter. Multiplying by a constant independent of the parameter preserves likelihood ratios within this model but may destroy its interpretation as a normalized data distribution.
Conditional independence must be stated rather than inferred from a convenient product. Repeated trials may be independent given one shared while remaining dependent after that shared parameter is integrated out. This explains why uncertainty about a common failure rate can induce dependence between future failures. A model with a new independent rate for every trial has different predictive implications. Decide which experiment you mean before evaluating a likelihood, and record selection or censoring rules when they affect what observations can appear.
Normalize and read the conditioning
For observed data with , division by the marginal density produces a proper posterior. With continuous observations, is a density, not the probability of observing one exact real number. Conditional densities are defined up to appropriate null sets, so pointwise formulas are understood where this denominator is legitimate. A posterior probability is conditional on both the observed information and the model assumptions. It is not automatically a statement about the long-run coverage of a confidence procedure at each fixed parameter.
A prior that assigns an event zero probability cannot acquire positive posterior probability through a finite, positive likelihood update. That is a support choice, not strong evidence manufactured by the data. Improper priors require separate proof that the posterior normalization is finite; they do not themselves define normalized prior predictive distributions. Parameter changes also matter: a density on a transformed scale requires its Jacobian. A flat density in one coordinate system generally becomes nonflat in another, so the word uninformative does not remove modeling decisions.
Predict before conditioning
Prior predictive checking asks what data the entire prior and sampling model jointly expect. Generate a parameter from the prior, then a complete data set conditionally on that parameter; inspect meaningful summaries such as extreme counts or differences between groups. A broad prior on a coefficient can imply implausibly enormous observations after a nonlinear transformation. Looking only at the parameter scale can miss this. The purpose is to reveal implications, rather than to tune a prior until it guarantees the desired posterior answer.
After observing data, repeat the same generative idea with the posterior to predict future observations. Keep parameter uncertainty separate from observation noise: even exact knowledge of a failure probability does not determine the next binary outcome. Prior predictive checks also do not prove that the model is correct. A plausible distribution of total counts can conceal implausible time ordering or dependence. Choose summaries tied to the application, document any revisions prompted by existing data, and examine sensitivity to reasonable alternative priors.
Work it through
Two possible component types
A component has success probability 0.2 with prior probability 0.75, or success probability 0.8 with prior probability 0.25. Conditional trials are independent given the component type. Observe one success and predict success on the next trial.
Compute the two joint masses of type and observed success: 0.75 times 0.2 equals 0.15, while 0.25 times 0.8 equals 0.20. These are joint probabilities, not yet posterior probabilities.
Add the joint masses to obtain the prior predictive probability of success, 0.35. Divide each joint mass by 0.35: posterior probabilities are 3/7 for the low-success type and 4/7 for the high-success type.
Average the next-trial success probabilities using these posterior weights. The result is 0.2 times 3/7 plus 0.8 times 4/7, equal to 19/35. Independence conditional on type is what permits reusing each type's success probability.
The high-success type has posterior probability 4/7; the next success probability is 19/35, approximately 0.543. Neither number is the likelihood 0.8.
The living notebook
Explore the model
Interactive lab · probability
Separate conditional count laws from a mixture
Pause and Reset, then set both controls to p=0.20 and n=10. Predict mean 2 before inspecting the bars. Reset and set p=0.80 and n=10; predict mean 8. These are the two conditional binomial laws in the example, not their prior or posterior mixture. Playback only highlights exact outcomes.
- Mean · np
- 5
- Variance · np(1−p)
- 2.5
- Total probability
- 1
These are exact binomial probabilities for independent trials with one fixed success probability. Playback tours the distribution; it does not resample outcomes. Parameter changes pause playback and recompute the model at the current elapsed time. Reset restores both parameters and returns time to zero. Playback starts paused. Adjust either parameter, then choose Play or Step.
Look forA predictive mixture would weight every bar from both conditional laws; replacing the uncertain parameter by one mean generally changes the distribution.
Pause & reason
Check your understanding
Your turn
Try it yourself
Use the same two-type model, but observe one failure. Find the posterior probability of the high-success type and the next-trial success probability.
Take a moment to make a prediction or work it out on paper. Open a hint when you need one.
Give me a hint
Replace each success likelihood by its complement before normalizing; keep the original prior weights.
Compare with the solution
The low-type joint failure mass is 0.75 times 0.8, or 0.60; the high-type mass is 0.25 times 0.2, or 0.05. Total failure probability is 0.65, so the high-type posterior probability is 1/13 and the low-type probability is 12/13. The next success probability is 0.2 times 12/13 plus 0.8 times 1/13, equal to 16/65, approximately 0.246. Failure shifts weight toward the low-success component without making its success probability zero.
Keep the idea
Take it with you
- A prior and sampling distribution define the joint model before updating.
- Posterior normalization requires a positive finite marginal data density.
- Predictive mixtures retain shared-parameter uncertainty and its induced dependence.
Read further
Original sources and deeper explanations to follow at your own pace.
Optional progress, saved in this browser when available. Revisit any lesson at any time.
Lesson not marked complete.