ES98A · Course contents

Week 3: Gaussian geometry and conditioning

Suppose two sensors respond to the same uncertain state. Reading the first should tell us something about the second, but how much? A covariance records the coupling; a Gaussian model makes that coupling sufficient to calculate the entire conditional law.

We use Week 2's probability space and covariance, SVD and Week 1's matrix square roots. These prerequisites let us focus on how a Gaussian law changes when some of its coordinates are observed. Computing expectations under more general laws is the subject of Week 4.

Gaussian random vectors

Build the distribution before writing its density

Let zz have independent standard normal coordinates and let x=m+C1/2zx=m+C^{1/2}z, where CC is SPSD. An eigenvector of CC with eigenvalue λ\lambda has standard deviation λ\sqrt\lambda. If λ=0\lambda=0, every draw has the same coordinate there. A Gaussian may consequently live on a lower-dimensional affine subspace and have no density relative to ambient volume.

The projection definition below includes this degenerate case. Think of ℓ\ell as a measuring ruler: every scalar reading is normal, with a mean and variance determined by m,Cm,C.

We say that an Rn\mathbb{R}^n-valued random variable/vector x‾\underline{x} follows a Gaussian/normal distribution with mean vector m∈Rnm\in\mathbb{R}^n and covariance matrix C∈Rn×nC\in\mathbb{R}^{n\times n}, denoted

x‾∼N(m,C),\underline{x}\sim\mathcal{N}(m,C),

if (equivalently)

  1. for every ℓ∈Rn\ell\in\mathbb{R}^n, ℓ⋅x‾\ell\cdot \underline{x} is a real-valued normally-distributed r.v. with mean ℓ⋅m\ell\cdot m and variance ℓ⊤Cℓ≥0\ell^\top C\ell\ge 0;

  2. the characteristic function Rn→C\mathbb{R}^n \to \mathbb{C}

ℓ↦E ⁣[exp⁡(i ℓ⋅x‾)]\ell \mapsto \mathbb{E}\!\left[\exp(i\,\ell\cdot \underline{x})\right]

takes the form

E ⁣[exp⁡(i ℓ⋅x‾)]=exp⁡ ⁣(i ℓ⋅m−12 ℓ⊤Cℓ);\mathbb{E}\!\left[\exp(i\,\ell\cdot \underline{x})\right] =\exp\!\left(i\,\ell\cdot m - \frac{1}{2}\,\ell^\top C\ell\right);
  1. [Valid only if CC is SPD i.e. if C−1C^{-1} exists] x‾\underline{x} has the PDF
px‾(x)=1det⁡(2πC) exp⁡ ⁣(−12 ∥C−1/2(x−m)∥2)p_{\underline{x}}(x)= \frac{1}{\sqrt{\det(2\pi C)}}\, \exp\!\left(-\frac{1}{2}\,\left\|C^{-1/2}(x-m)\right\|^2\right)

i.e.

P[x‾∈A]=∫A1det⁡(2πC) exp⁡ ⁣(−12 ∥C−1/2(x−m)∥2) dx,A⊆Rn.\mathbb{P}[\underline{x}\in A] = \int_A \frac{1}{\sqrt{\det(2\pi C)}}\, \exp\!\left(-\frac{1}{2}\,\left\|C^{-1/2}(x-m)\right\|^2\right)\,dx, \qquad A\subseteq \mathbb{R}^n.

Keep the underlying standardised draws fixed while changing their covariance. This couples the before and after views: movement comes from the covariance transformation, not from drawing a different random sample.

Covariance shapes the same standardised draws

Same standard-normal draws

-3.503.5-3.503.5z₁z₂

Correlated draws

-3.503.5-3.503.5x₁x₂

ρ=0.000, C eigenvalues = 1.000, 1.000

The cloud leans towards x₁=x₂. Narrowing in one principal direction balances widening in the other; both coordinate variances remain one.

Play once, pause, or scrub to inspect an intermediate state.

Ready to explore.
Transform the same deterministic illustrative standard-normal draws by a covariance factor L satisfying LL*=C=[[1,ρ],[ρ,1]]. Both marginal variances stay one while the principal variances become 1+ρ and 1−ρ. The ellipse is the one-Mahalanobis-radius contour, not a confidence region with unspecified coverage. ↗

Linear images of Gaussians are again Gaussian!

Let x‾∼N(m,C)\underline{x}\sim\mathcal{N}(m,C) in Rn\mathbb{R}^n and fix A∈Rp×nA\in\mathbb{R}^{p\times n} and consider

y‾:=Ax‾\underline{y}:=A\underline{x}

in Rp\mathbb{R}^p. Then y‾\underline{y} is a Rp\mathbb{R}^p-valued Gaussian, and in fact

y‾∼N(Am,ACA⊤).\underline{y}\sim\mathcal{N}(Am,ACA^\top).

To see this:

E ⁣[exp⁡(i ℓ⋅y‾)]=E ⁣[exp⁡ ⁣(i ℓ⋅(Ax‾))]=E ⁣[exp⁡ ⁣(i (A⊤ℓ)⋅x‾)],ℓ∈Rp,\mathbb{E}\!\left[\exp(i\,\ell\cdot \underline{y})\right] = \mathbb{E}\!\left[\exp\!\left(i\,\ell\cdot (A\underline{x})\right)\right] = \mathbb{E}\!\left[\exp\!\left(i\,(A^\top \ell)\cdot \underline{x}\right)\right], \qquad \ell\in\mathbb{R}^p, =exp⁡ ⁣(i (A⊤ℓ)⋅m−12 (A⊤ℓ)⊤C(A⊤ℓ))=exp⁡ ⁣(i ℓ⋅(Am)−12 ℓ⊤(ACA⊤)ℓ).= \exp\!\left(i\,(A^\top \ell)\cdot m - \frac{1}{2}\,(A^\top \ell)^\top C (A^\top \ell)\right) = \exp\!\left(i\,\ell\cdot (Am) - \frac{1}{2}\,\ell^\top (ACA^\top)\ell\right).

Another nice property of Gaussians is that their conditional distributions are Gaussian, and the conditional mean and covariance are easy to calculate using linear algebra.

The transformation theorem explains forward uncertainty propagation: AA acts on the mean once and on the covariance on both sides. Conditioning runs a different calculation. We keep the observed value fixed and ask which uncertainty remains compatible with it; it is not an inverse matrix operation on the sample itself.

Conditioning theorem

Let

x‾=(x‾1x‾2)\underline{x}=\begin{pmatrix}\underline{x}_1\\ \underline{x}_2\end{pmatrix}

be an Rn\mathbb{R}^n-valued Gaussian, with x‾1\underline{x}_1 denoting the first n1n_1 components and x‾2\underline{x}_2 denoting the remaining n2n_2 components, n1+n2=nn_1+n_2=n.

Write the mean mm and cov. CC of x‾\underline{x} in block form as

E[x‾]=m=(m1m2),Cov[x‾]=C=(C11C12C21C22),\mathbb{E}[\underline{x}] = m = \begin{pmatrix}m_1\\ m_2\end{pmatrix}, \qquad \mathrm{Cov}[\underline{x}] = C = \begin{pmatrix} C_{11} & C_{12}\\ C_{21} & C_{22} \end{pmatrix},

with m1∈Rn1m_1\in\mathbb{R}^{n_1}, m2∈Rn2m_2\in\mathbb{R}^{n_2}, C11∈Rn1×n1C_{11}\in\mathbb{R}^{n_1\times n_1}, C12=C21⊤C_{12}=C_{21}^\top, ...

Assume that CC and C22C_{22} are invertible (generalizations are possible). Then, for every x2∈Rn2x_2\in\mathbb{R}^{n_2}, x‾1 ∣ x‾2=x2\underline{x}_1\,|\,\underline{x}_2=x_2 is Gaussian,

x‾1 ∣ x‾2=x2∼N(m1′,C11′),\underline{x}_1\,|\,\underline{x}_2=x_2 \sim \mathcal{N}(m_1',C_{11}'),

where

m1′=m1+C12C22−1(x2−m2),m_1' = m_1 + C_{12}C_{22}^{-1}(x_2-m_2), C11′=C11−C12C22−1C21,(C21=C12⊤).C_{11}' = C_{11} - C_{12}C_{22}^{-1}C_{21}, \qquad (C_{21}=C_{12}^\top).

Kalman update formulae

What changes when the two sensors are correlated? Compare the same observation x2=1x_2=1 under two joint Gaussian models.

Uncorrelated sensorsUncorrelated sensorsx₁density-3300.7conditional = marginal
Correlation 0.8Correlation 0.8x₁density-3300.7solid: conditional on x₂ = 1dashed: marginal
Unit marginal variances and zero prior means. With correlation 0.8, the conditional mean is 0.8 and variance is 0.36. Axes match across panels. ↗

The correlated reading moves the centre and narrows the distribution. The next derivation explains both changes using an independent Gaussian residual.

Move the observed coordinate through the joint Gaussian. Predict which property of the conditional law changes and which stays fixed before playing the sequence.

An observation moves the conditional distribution

Observed coordinate

-2.502.5-2.502.5x₁x₂

Conditional law of x₁

-3.503.500.75x₁density

b=-2.000, conditional mean=-1.600, variance=0.360

The observation changes the centre, while the conditional variance stays fixed because the joint model and correlation have not changed.

Play once, pause, or scrub to inspect an intermediate state.

Ready to explore.
Zero-mean joint Gaussian with unit marginal variances and fixed correlation 0.8. As x₂=b moves, x₁|x₂=b has mean 0.8b and variance 0.36. The dashed marginal stays fixed. This is Gaussian conditioning, not geometric truncation of the cloud. ↗

Why the update is a projection

Set K=C12C22−1K=C_{12}C_{22}^{-1} and form the residual random vector

r=x1−m1−K(x2−m2).r=x_1-m_1-K(x_2-m_2).

Then Cov⁡(r,x2)=C12−KC22=0\operatorname{Cov}(r,x_2)=C_{12}-KC_{22}=0 and Cov⁡(r)=C11−C12C22−1C21\operatorname{Cov}(r)=C_{11}-C_{12}C_{22}^{-1}C_{21}. The pair (r,x2)(r,x_2) is jointly Gaussian by the linear-image theorem. Its characteristic function factors because the cross covariance vanishes, so rr and x2x_2 are independent. Conditioning now fixes only the term K(x2−m2)K(x_2-m_2) and leaves the residual law unchanged. This proves the theorem and explains why the conditional covariance does not depend on the observed value.

For scalar unit-variance coordinates with correlation ρ\rho, observing x2=bx_2=b gives mean ρb\rho b and variance 1−ρ21-\rho^2. When ρ=0\rho=0, nothing is learned. As ∣ρ∣|\rho| approaches one, very little uncertainty remains. Covariance reduction is SPSD because it is the covariance of rr, not merely a formal subtraction.

Check your understanding. Zero covariance implies independence here because the joint law is Gaussian. Give a non-Gaussian counterexample by taking XX uniform on [−1,1][-1,1] and Y=X2Y=X^2.

The update gives exact answers for Gaussian models. For other laws we often need expectations that cannot be evaluated symbolically. Week 4 replaces analytic integration with sampling.