BRAGA

02 Writing02-02 Notes02-02-420

Posterior Mean (MAP)

Published 16 Apr 20263 min read
Contents
  1. 01Deep Breakdown
  2. 02Flowchart
mN=SN(S0−1m0+1σ2X⊤y)m_N = S_N \left(S_0^{-1} m_0 + \frac{1}{\sigma^2} X^\top y\right)
(1)

We are working on the posterior mean in Bayesian Linear Regression, with canonical formula mN=SN(S0−1m0+1σ2X⊤y)m_N = S_N \left(S_0^{-1} m_0 + \frac{1}{\sigma^2} X^\top y\right), where w∣X,y∼N(mN,SN)w \mid X, y \sim \mathcal{N}(m_N, S_N) under a Gaussian prior and Gaussian likelihood. The domain is finite-dimensional Bayesian linear regression with known observation noise variance σ2\sigma^2, prior w∼N(m0,S0)w \sim \mathcal{N}(m_0, S_0), and design matrix XX. In this Gaussian case, the posterior is Gaussian, its mean equals its mode, and it acts as a Bayesian regularized regression estimate.

Deep Breakdown

In Bayesian Linear Regression, we do not treat the regression coefficients ww as fixed unknown numbers. Instead, we model them probabilistically. Before seeing data, we express belief through a prior:

w∼N(m0,S0)w \sim \mathcal{N}(m_0, S_0)
(2)

Then we observe training data (X,y)(X, y) under a Gaussian likelihood:

y∣X,w∼N(Xw,σ2I)y \mid X, w \sim \mathcal{N}(Xw, \sigma^2 I)
(3)

After combining prior and likelihood, we obtain the posterior distribution:

w∣X,y∼N(mN,SN)w \mid X, y \sim \mathcal{N}(m_N, S_N)
(4)

The posterior mean is:

mN=SN(S0−1m0+1σ2X⊤y)m_N = S_N \left(S_0^{-1} m_0 + \frac{1}{\sigma^2} X^\top y\right)
(5)

and the posterior covariance is:

SN=(S0−1+1σ2X⊤X)−1S_N = \left(S_0^{-1} + \frac{1}{\sigma^2} X^\top X\right)^{-1}
(6)

This posterior mean is central because it is the main point summary of the posterior distribution. In the Gaussian case, the posterior is symmetric and unimodal, so:

  • posterior mean = posterior mode = MAP estimate,
  • posterior mean is a shrinkage estimate,
  • the estimate balances prior belief and sample evidence.

Why this matters in DA/DS:

  • Regularized estimation: it behaves like ridge regression when the prior is zero-mean isotropic.
  • Bayesian point estimate: it gives a single coefficient vector when you need one practical model.
  • Uncertainty-aware learning: unlike ordinary least squares, it arises from a full posterior distribution.
  • Stability with collinearity or low sample size: prior precision stabilizes estimates.
  • Interpretability of influence: the term S0−1m0S_0^{-1} m_0 represents prior pull, while 1σ2X⊤y\frac{1}{\sigma^2} X^\top y represents evidence from data.

A useful operational interpretation:

  • If the prior is strong and data is weak, mNm_N stays close to m0m_0.
  • If the data is strong and the prior is weak, mNm_N moves closer to the classical regression solution.
  • If predictors are highly correlated, the prior helps prevent unstable coefficient values.

Flowchart

Start with designmatrix X andtarget vector ySpecify prior w ~N(m_0, S_0)SpecifyGaussianlikelihood y | X,w~ N(Xw, sigma^2I)Computeposteriorcovariance S_N= (S_0^{-1} +(1/sigma^2) X^TX)^{-1}Computeposterior meanm_N =S_N(S_0^{-1}m_0 +(1/sigma^2)X^Ty)Interpret asbalancebetween priorinformation anddata evidenceUse m_N asposterior meanand MAP pointestimate

#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