Posterior Predictive
Distribution
Learn how to predict future observations by integrating over parameter uncertainty: the heart of Bayesian prediction.
What is Prediction in Statistics?
In statistics, prediction means estimating the value of a new, yet-unseen observation \(\tilde{y}\) given data we have already collected \(y_1, \dots, y_n\). The key question is: how do we account for uncertainty in the model parameters when making that prediction?
The Big Idea: Averaging Over Uncertainty
Instead of conditioning on a single parameter estimate, the posterior predictive distribution integrates out the parameter \(\theta\). This produces predictions that honestly reflect both sampling variability and parameter uncertainty.
Visualising the Integration
Formal Definition
This is an expectation of the likelihood with respect to the posterior: $$ p(\tilde{y}\mid y) = \mathbb{E}_{\theta\mid y}\!\big[p(\tilde{y}\mid\theta)\big]. $$
Three Ingredients
Prior vs Posterior Predictive
| Prior Predictive | Posterior Predictive | |
|---|---|---|
| Formula | \(\int p(\tilde{y}\mid\theta)\,p(\theta)\,d\theta\) | \(\int p(\tilde{y}\mid\theta)\,p(\theta\mid y)\,d\theta\) |
| Uses data? | No | Yes |
| Mixing distribution | Prior \(p(\theta)\) | Posterior \(p(\theta\mid y)\) |
| Spread | Wider (more uncertain) | Narrower (data-informed) |
| Primary use | Model checking before fitting | Forecasting new observations |
How to Compute It
Monte Carlo Shortcut
When the integral has no closed form, use composition sampling:
Example 1: Beta-Binomial
Setup: A coin is flipped \(n=10\) times with \(y=7\) heads. Prior: \(\theta\sim\text{Beta}(2,2)\). Find the posterior predictive probability of heads on the next flip.
Example 2: Normal-Normal
Setup: \(y_i \mid \mu \sim N(\mu, \sigma^2)\) with \(\sigma^2\) known. Prior: \(\mu\sim N(\mu_0, \tau_0^2)\). What is \(p(\tilde{y}\mid y)\)?
Variance Decomposition
Example 3: Poisson-Gamma
Setup: Daily customer arrivals \(y_i\mid\lambda\sim\text{Poisson}(\lambda)\). Observe \(n=30\) days with \(\sum y_i = 150\). Prior: \(\lambda\sim\text{Gamma}(3,1)\).
Why the PPD is Over-dispersed
The law of total variance gives a clean decomposition:
This is why Bayesian prediction intervals are wider (more honest) than plug-in intervals.
Uses of the PPD
Common Mistakes
Summary of Key Distributions
| Distribution | Formula | What it describes |
|---|---|---|
| Prior | \(p(\theta)\) | Beliefs about \(\theta\) before data |
| Likelihood | \(p(y\mid\theta)\) | How data arise given \(\theta\) |
| Posterior | \(p(\theta\mid y)\) | Updated beliefs about \(\theta\) |
| Prior Predictive | \(\int p(\tilde{y}\mid\theta)p(\theta)d\theta\) | New data before observing anything |
| Posterior Predictive | \(\int p(\tilde{y}\mid\theta)p(\theta\mid y)d\theta\) | New data after observing \(y\) |
Question 1 of 5
Which integral correctly defines the posterior predictive distribution?
Question 2 of 5
In the Normal-Normal model with known \(\sigma^2\), the posterior predictive variance is:
Question 3 of 5
In the Beta-Binomial example with prior \(\text{Beta}(2,2)\) and observing 7 heads in 10 flips, the posterior predictive probability of heads on the next flip is:
Question 4 of 5
As \(n \to \infty\), the posterior predictive variance in a well-specified model:
Question 5 of 5
To approximate the posterior predictive distribution via Monte Carlo, you: