Gaussian distributions have the nice algebraic property of being closed under conditioning and marginalization. Being closed under conditioning and marginalization means that the resulting distributions from these operations are also Gaussian

Problem

Given a Multivariate Normal (MVN) distribution, calculate its marginal and conditional distribution

Solution

Marginalizing an MVN Distribution

Given a multivariate gaussian distribution 𝐏(𝑋,𝑌) defined below

Indent

Marginalizing the set of random variables 𝑋 from 𝐏(𝑋,𝑌) yields:

  • 𝐏(𝑋) = 𝒩(𝜇𝑋,𝛴𝑋𝑋)

Marginalizing the set of random variables 𝑌 from 𝐏(𝑋,𝑌) yields:

  • 𝐏(𝑌) = 𝒩(𝜇𝑌,𝛴𝑌𝑌)

Conditioning an MVN Distribution

Given a multivariate gaussian distribution 𝐏(𝑋,𝑌) defined below

Indent

Conditioning 𝐏(𝑋,𝑌) to yield 𝐏(𝑋|𝑌):

  • 𝐏(𝑋|𝑌) = 𝒩(𝜇𝑋 + 𝛴𝑋𝑌𝛴𝑌𝑌-1(𝑌 - 𝜇𝑌), 𝛴𝑋𝑋 - 𝛴𝑋𝑌𝛴𝑌𝑌-1𝛴𝑌𝑋)

Conditioning 𝐏(𝑌,𝑋) to yield 𝐏(𝑌|𝑋):

  • 𝐏(𝑌|𝑋) = 𝒩(𝜇𝑌 + 𝛴𝑌𝑋𝛴𝑋𝑋-1(𝑋 - 𝜇𝑋), 𝛴𝑌𝑌 - 𝛴𝑌𝑋𝛴𝑋𝑋-1𝛴𝑋𝑌)

This operation is the cornerstone of Gaussian process Regression since it allows Bayesian inference

Note that the new mean only depends on the conditioned variable, while the covariance matrix is independent of this variable

Proof

TODO

Resources