In this very short note, I will describe how to sample from a specific level set of a -dimensional Gaussian.
Ellipsoids
A -dimensional ellipsoid in is defined by the following equation
where is the center of the ellipsoid and is an positive-definite symmetric matrix.
Gaussian Level-Sets as Ellipsoids
Consider a multivariate Gaussian distribution with covariance matrix and mean with density
The maximum density value achieved is as can be seen by setting the gradient to zero
For any positive value , denotes the -level set of . We wish to show that this is a -dimensional ellipsoid in . The level set is the following set of points
Since is a monotone function, this is equivalent to
Rearranging terms we get
where we have defined the constant
Since the LHS is a quadratic form, must be positive so we can divide through to obtain
Therefore they are ellipsoids centered at with matrix .
Sampling from the level set
To sample exactly from this level set we follow the following algorithm:
- Sample
- Set so that
- Obtain sample where is the Cholesky decomposition of , i.e.