How Is the Multivariate Gaussian Density Derived?
At a glance
- 1. Start with standard normals
Use the density of a vector whose coordinates are independent standard normal variables.
- 2. Apply an affine map
Transform that vector so its mean is the desired mean and its covariance is the desired matrix.
- 3. Track the Jacobian
The change of variables contributes the square root of the covariance determinant.
- 4. Rewrite the exponent
Express the transformed squared length using the inverse covariance matrix.
A multivariate Gaussian, or multivariate normal, distribution describes a random vector using a mean vector and a covariance matrix. Its density is the higher-dimensional counterpart of the familiar one-dimensional normal density.
The formula follows directly from a change of variables: start with independent standard normal coordinates, transform them to have the desired covariance, and shift them to the desired mean. The determinant in the density comes from the change in volume under that transformation.
The multivariate Gaussian density
Let be a multivariate normal random vector in with mean vector and positive-definite covariance matrix . Its density at is
Here, is the number of dimensions, is the inverse covariance matrix, and is its determinant. The exponent contains the squared Mahalanobis distance from to the mean. Unlike ordinary squared distance, this measure accounts for the variables’ different scales and their correlations.
The condition that be positive definite ensures it is invertible and that the multivariate normal distribution has an ordinary density over all of .
Derivation by change of variables
Let , where the coordinates are independent standard normal variables. Its joint density is the product of the one-dimensional densities:
Choose a nonsingular matrix such that . Such a matrix exists for every positive-definite covariance matrix; a Cholesky factor is a common choice. Define
This transformation gives mean and covariance . To find its density, solve for :
The change-of-variables formula multiplies the density by the absolute Jacobian determinant. Since the derivative of with respect to is , that factor is . Also,
so . The exponent transforms as
because . Substituting the exponent and Jacobian into the standard normal density gives the stated formula.
Worked two-dimensional example
Consider a bivariate normal vector with
The determinant is , and the inverse is
Writing and , the density becomes
For example, at , we have and . The numerator of the quadratic expression is , so the exponent is . Thus the density there is . This is a density value, not the probability of observing that exact point; for a continuous distribution, probabilities are calculated over regions.
Why the determinant and inverse appear
The determinant measures how the transformation scales volume. A covariance matrix that spreads probability across a larger volume has a larger determinant, so the density’s peak is scaled down by . This factor ensures the density integrates to one.
The inverse covariance matrix determines the shape of the exponent’s contours. Directions with large variance contribute less to the quadratic distance, while directions with small variance contribute more. Off-diagonal entries of encode relationships between coordinates and produce cross-terms, such as in the example.
If is diagonal, the coordinates are uncorrelated; for a multivariate normal vector, they are then independent. The multivariate density reduces to the product of the corresponding one-dimensional normal densities.
Common mistakes
- Using instead of its square root. The Jacobian is , which equals .
- Putting in the quadratic form. The correct matrix is ; covariance itself describes spread, not the inverse weighting used in the exponent.
- Leaving out the factor . It is inherited from the standard normal density.
- Assuming the formula works unchanged for singular covariance. If is singular, there is no ordinary density over all of ; the distribution is concentrated on a lower-dimensional subspace and needs a different treatment.
References
- Multivariate Statistical Analysis, K. V. Mardia, J. T. Kent, and J. M. Bibby
Spotted an error? Send a correction. Read how we write and check articles in our editorial policy.