BRAGA

02 Writing02-02 Notes02-02-421

Posterior Predictive Distribution

Published 16 Apr 20263 min read
Contents
  1. 01Deep Breakdown
  2. 02Flowchart
p(ynew∣xnew,D)=N(xnew⊤mN,  σ2+xnew⊤SNxnew)p(y_{\text{new}} \mid x_{\text{new}}, D) = \mathcal{N}\left(x_{\text{new}}^\top m_N,\; \sigma^2 + x_{\text{new}}^\top S_N x_{\text{new}}\right)
(1)

We are working on the posterior predictive distribution in Bayesian Linear Regression, with canonical formula p(ynew∣xnew,D)=N(xnew⊤mN,  σ2+xnew⊤SNxnew)p(y_{\text{new}} \mid x_{\text{new}}, D) = \mathcal{N}\left(x_{\text{new}}^\top m_N,\; \sigma^2 + x_{\text{new}}^\top S_N x_{\text{new}}\right), where mNm_N is the posterior mean of the regression weights, SNS_N is the posterior covariance, and σ2\sigma^2 is the observation noise variance. The domain is Gaussian Bayesian linear regression with known noise variance, Gaussian prior, Gaussian posterior over weights, and a new feature vector xnewx_{\text{new}}. This predictive distribution includes both irreducible observation noise and parameter uncertainty.

Deep Breakdown

In Bayesian Linear Regression, we do not produce only a single predicted number for a new input. Instead, we produce a full probability distribution for the future response. That distribution is called the posterior predictive distribution. Suppose we have already observed a training dataset:

D={X,y}D = \{X, y\}
(2)

and from this dataset we obtained the posterior over regression weights:

w∣D∼N(mN,SN)w \mid D \sim \mathcal{N}(m_N, S_N)
(3)

Now for a new feature vector xnewx_{\text{new}}, the data-generating model says:

ynew=xnew⊤w+εnew,εnew∼N(0,σ2)y_{\text{new}} = x_{\text{new}}^\top w + \varepsilon_{\text{new}}, \qquad \varepsilon_{\text{new}} \sim \mathcal{N}(0, \sigma^2)
(4)

Because ww is uncertain and the new observation has noise, the predicted response is also uncertain. The predictive distribution is found by integrating over the posterior uncertainty in ww:

p(ynew∣xnew,D)=∫p(ynew∣xnew,w) p(w∣D) dwp(y_{\text{new}} \mid x_{\text{new}}, D) = \int p(y_{\text{new}} \mid x_{\text{new}}, w)\, p(w \mid D)\, dw
(5)

In Gaussian Bayesian linear regression, this integral has a closed form:

p(ynew∣xnew,D)=N(xnew⊤mN,  σ2+xnew⊤SNxnew)p(y_{\text{new}} \mid x_{\text{new}}, D) = \mathcal{N}\left( x_{\text{new}}^\top m_N,\; \sigma^2 + x_{\text{new}}^\top S_N x_{\text{new}} \right)
(6)

This formula has two parts:

  • the predictive mean xnew⊤mNx_{\text{new}}^\top m_N, which is the average predicted value,
  • the predictive variance σ2+xnew⊤SNxnew\sigma^2 + x_{\text{new}}^\top S_N x_{\text{new}}, which combines noise and parameter uncertainty.

Why this matters in DA/DS:

  • Forecast intervals: gives uncertainty bands around predictions, not only point estimates.
  • Decision quality: helps distinguish “high expected value, low confidence” from “high expected value, high confidence.”
  • Risk-aware modeling: important in finance, marketing, operations, supply chain, and demand forecasting.
  • Out-of-sample caution: predictions far from the training region often have larger uncertainty.
  • Transparent uncertainty decomposition: one part is data noise, another part is uncertainty about coefficients.

A useful mental model is this:

  • if you knew the regression weights exactly, uncertainty would come only from σ2\sigma^2,
  • but because you do not know the weights exactly, there is an extra uncertainty term xnew⊤SNxnewx_{\text{new}}^\top S_N x_{\text{new}}.

So Bayesian prediction is not just “a line with noise.” It is “a line with uncertainty about the line itself.”

Flowchart

Start withtraining data D ={X, y}Fit Bayesianlinear regressionObtain posteriorover weights: w |D ~ N(m_N,S_N)Take new inputvector x_newComputepredictive mean:x_new^T m_NComputeparameteruncertainty:x_new^T S_Nx_newAdd observationnoise: sigma^2Form predictivedistributiony_new | x_new,D ~ N(x_new^Tm_N, sigma^2 +x_new^T S_Nx_new)Use forforecasts,intervals, anduncertainty-aware decisions

#machine-learning#machine-learning-algorithms#bayesian-linear-regression-blr

Keyboard shortcuts

Single keys, ignored while typing in a field or with Cmd, Ctrl or Alt held.

0
Home
1 2 3 4
Work, Writing, Tools, About
j / k
Next / previous section on this page
n / p
Next / previous project or essay
u
Up one level
l
Deutsch
t
Light or dark theme
?
This list
Esc
Close