01 / 22

Posterior Predictive
Distribution

Learn how to predict future observations by integrating over parameter uncertainty: the heart of Bayesian prediction.

Graduate Statistics

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?

Frequentist
Plug in the MLE \(\hat{\theta}\) and predict from \(p(\tilde{y}\mid\hat{\theta})\). Parameter uncertainty is ignored.
Bayesian
Average over all possible \(\theta\) weighted by the posterior. This is the posterior predictive distribution.

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

\(\tilde{y}\) density \(p(\tilde{y}\mid\theta_1)\) \(p(\tilde{y}\mid\theta_2)\) \(p(\tilde{y}\mid\theta_3)\) \(p(\tilde{y}\mid\theta_4)\) Posterior Predictive \(p(\tilde{y}\mid y)\)

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

1
Prior \(p(\theta)\): your beliefs about \(\theta\) before seeing data.
2
Likelihood \(p(y\mid\theta)\): how the data arise given \(\theta\). Combined with the prior via Bayes' theorem to get the posterior \(p(\theta\mid y)\).
3
Sampling model for \(\tilde{y}\): \(p(\tilde{y}\mid\theta)\). Often the same family as the likelihood but for a single new draw.

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

1
Specify the model: choose \(p(y\mid\theta)\) and a prior \(p(\theta)\).
2
Derive the posterior: compute \(p(\theta\mid y) \propto p(y\mid\theta)\,p(\theta)\).
3
Write the integral: \(p(\tilde{y}\mid y)=\int p(\tilde{y}\mid\theta)\,p(\theta\mid y)\,d\theta\).
4
Solve analytically (conjugate families) or simulate: draw \(\theta^{(s)}\sim p(\theta\mid y)\), then draw \(\tilde{y}^{(s)}\sim p(\tilde{y}\mid\theta^{(s)})\). The collection \(\{\tilde{y}^{(s)}\}\) approximates the PPD.

Monte Carlo Shortcut

When the integral has no closed form, use composition sampling:

1
For \(s = 1, \dots, S\): draw \(\theta^{(s)} \sim p(\theta\mid y)\).
2
Then draw \(\tilde{y}^{(s)} \sim p(\tilde{y}\mid\theta^{(s)})\).
3
The empirical distribution of \(\{\tilde{y}^{(s)}\}_{s=1}^{S}\) approximates \(p(\tilde{y}\mid y)\).

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.

1
Posterior: conjugacy gives \(\theta\mid y \sim \text{Beta}(2+7,\;2+3) = \text{Beta}(9,5)\).
2
Predictive for single trial: \(p(\tilde{y}=1\mid y) = \int_0^1 \theta\;\text{Beta}(\theta;9,5)\,d\theta = \mathbb{E}[\theta\mid y]\).
3
Result: \(\mathbb{E}[\theta\mid y] = \dfrac{9}{9+5} = \dfrac{9}{14} \approx 0.643\).

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

\(\tilde{y}\) \(p(\mu\mid y)\) var = \(\tau_n^2\) \(p(\tilde{y}\mid y)\) var = \(\sigma^2+\tau_n^2\)

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)\).

1
Posterior: \(\lambda\mid y \sim \text{Gamma}(3+150,\;1+30) = \text{Gamma}(153,31)\).
2
PPD: Integrating Poisson(\(λ\)) against Gamma yields a Negative Binomial: $$ \tilde{y}\mid y \sim \text{NegBin}\!\left(r=153,\;p=\frac{31}{32}\right). $$
3
Predictive mean: \(\mathbb{E}[\tilde{y}\mid y]=\frac{153}{31} \approx 4.94\). Predictive variance: \(\approx 5.10\), slightly larger than the Poisson plug-in variance of \(5.0\).

Why the PPD is Over-dispersed

The law of total variance gives a clean decomposition:

First term
Average noise from the sampling model, even if \(\theta\) were known.
Second term
Extra uncertainty because \(\theta\) itself is uncertain: always \(\geq 0\).

This is why Bayesian prediction intervals are wider (more honest) than plug-in intervals.

Uses of the PPD

Forecasting
Predict future data with calibrated uncertainty: prediction intervals, decision analysis.
Model Checking
Simulate replicated data \(y^{\text{rep}}\) from the PPD and compare to real data (posterior predictive checks).
Model Comparison
Compute predictive log-likelihood (LOO-CV, WAIC) to rank models by out-of-sample fit.

Common Mistakes

Plug-in Prediction
Using \(p(\tilde{y}\mid\hat{\theta})\) instead of integrating over \(\theta\). This underestimates predictive uncertainty.
Confusing Posterior with PPD
The posterior \(p(\theta\mid y)\) is about the parameter. The PPD \(p(\tilde{y}\mid y)\) is about a future observation. They live in different spaces.
Forgetting Sampling Noise
Even with infinite data (\(\tau_n^2\to 0\)), the PPD retains irreducible variance \(\sigma^2\). It never collapses to a point.

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: