← Math simulations  ·  EE263, Stanford

Conditioning a Gaussian: slice, then renormalize

The joint density of x = (x1, x2) is shown as its elliptical level sets. Observing x2 = w restricts you to one horizontal line: drag it. The density along that line, rescaled to have area one, is the conditional density p(x1 | x2 = w) drawn below. It is again Gaussian, its mean moves affinely with w along the orange line, and its variance does not depend on w at all.

Joint covariance

Σ =
2.000.80 0.801.00

Observation

E(x1 | x2 = w)1.60
cov(x1 | x2 = w)1.36
std(x1 | x2 = w)1.17
before observing: var(x1)2.00
variance left: 1 − ρ20.68

Presets

Show

level sets of the joint density
the slice x2 = w, and the conditional density
E(x1 | x2), affine in the observation

Below: the density along the red line. Dragging the line slides this curve sideways without ever changing its width.