The Multivariate Gaussian Distribution

Similar documents
x. Figure 1: Examples of univariate Gaussian pdfs N (x; µ, σ 2 ).

EEL 5544 Noise in Linear Systems Lecture 30. X (s) = E [ e sx] f X (x)e sx dx. Moments can be found from the Laplace transform as

8 Eigenvectors and the Anisotropic Multivariate Gaussian Distribution

MLES & Multivariate Normal Theory

Gaussian random variables inr n

Perhaps the simplest way of modeling two (discrete) random variables is by means of a joint PMF, defined as follows.

5. Random Vectors. probabilities. characteristic function. cross correlation, cross covariance. Gaussian random vectors. functions of random vectors

Multivariate Gaussian Distribution. Auxiliary notes for Time Series Analysis SF2943. Spring 2013

The Multivariate Gaussian Distribution [DRAFT]

The Multivariate Normal Distribution

3. Probability and Statistics

2.3. The Gaussian Distribution

Gaussian processes. Chuong B. Do (updated by Honglak Lee) November 22, 2008

Moment Generating Function. STAT/MTHE 353: 5 Moment Generating Functions and Multivariate Normal Distribution

Chapter 5. The multivariate normal distribution. Probability Theory. Linear transformations. The mean vector and the covariance matrix

Lecture 11. Multivariate Normal theory

16.584: Random Vectors

Eigenvectors and SVD 1

2. Matrix Algebra and Random Vectors

Vectors and Matrices Statistics with Vectors and Matrices

Random Vectors 1. STA442/2101 Fall See last slide for copyright information. 1 / 30

IEOR 4701: Stochastic Models in Financial Engineering. Summer 2007, Professor Whitt. SOLUTIONS to Homework Assignment 9: Brownian motion

Multivariate Distributions

01 Probability Theory and Statistics Review

The Multivariate Normal Distribution. In this case according to our theorem

Elements of Probability Theory

Recall the convention that, for us, all vectors are column vectors.

APPENDIX A. Background Mathematics. A.1 Linear Algebra. Vector algebra. Let x denote the n-dimensional column vector with components x 1 x 2.

Principal Components Theory Notes

Lecture Notes on the Gaussian Distribution

Lecture Note 1: Probability Theory and Statistics

Review of Probability Theory

Whitening and Coloring Transformations for Multivariate Gaussian Data. A Slecture for ECE 662 by Maliha Hossain

Statistics 351 Probability I Fall 2006 (200630) Final Exam Solutions. θ α β Γ(α)Γ(β) (uv)α 1 (v uv) β 1 exp v }

Unsupervised Learning: Dimensionality Reduction

Econ 204 Supplement to Section 3.6 Diagonalization and Quadratic Forms. 1 Diagonalization and Change of Basis

A A x i x j i j (i, j) (j, i) Let. Compute the value of for and

Elliptically Contoured Distributions

Problem Solving. Correlation and Covariance. Yi Lu. Problem Solving. Yi Lu ECE 313 2/51

Random Variables and Their Distributions

Joint Probability Distributions and Random Samples (Devore Chapter Five)

8 - Continuous random vectors

III - MULTIVARIATE RANDOM VARIABLES

The Hilbert Space of Random Variables

Basic Concepts in Matrix Algebra

Stat 206: Sampling theory, sample moments, mahalanobis

Random Vectors, Random Matrices, and Matrix Expected Value

Bayesian Decision Theory

Introduction to Probability and Stocastic Processes - Part I

Tutorials in Optimization. Richard Socher

Notes on Random Vectors and Multivariate Normal

BASICS OF PROBABILITY

Multivariate Random Variable

Appendix 2. The Multivariate Normal. Thus surfaces of equal probability for MVN distributed vectors satisfy

Let X and Y denote two random variables. The joint distribution of these random

Symmetric matrices and dot products

Stat 206: Linear algebra

DS-GA 1002 Lecture notes 0 Fall Linear Algebra. These notes provide a review of basic concepts in linear algebra.

3d scatterplots. You can also make 3d scatterplots, although these are less common than scatterplot matrices.

Gaussian Models (9/9/13)

Chapter 6. Eigenvalues. Josef Leydold Mathematical Methods WS 2018/19 6 Eigenvalues 1 / 45

Joint Distributions. (a) Scalar multiplication: k = c d. (b) Product of two matrices: c d. (c) The transpose of a matrix:

STA 2201/442 Assignment 2

THE UNIVERSITY OF HONG KONG DEPARTMENT OF MATHEMATICS

Lecture 22: A Review of Linear Algebra and an Introduction to The Multivariate Normal Distribution

matrix-free Elements of Probability Theory 1 Random Variables and Distributions Contents Elements of Probability Theory 2

Lecture 6 Positive Definite Matrices

September Math Course: First Order Derivative

Discrete Mathematics and Probability Theory Fall 2015 Lecture 21

Mathematical Tools for Multivariate Character Analysis

Recall that if X 1,...,X n are random variables with finite expectations, then. The X i can be continuous or discrete or of any other type.

Chapter 5 continued. Chapter 5 sections

Motivating the Covariance Matrix

Introduction to Matrices

Introduction to Machine Learning

Section 8.1. Vector Notation

Review of Linear Algebra

This appendix provides a very basic introduction to linear algebra concepts.

P (x). all other X j =x j. If X is a continuous random vector (see p.172), then the marginal distributions of X i are: f(x)dx 1 dx n

1. General Vector Spaces

Covariance. Lecture 20: Covariance / Correlation & General Bivariate Normal. Covariance, cont. Properties of Covariance

(Multivariate) Gaussian (Normal) Probability Densities

18 Bivariate normal distribution I

HW2 - Due 01/30. Each answer must be mathematically justified. Don t forget your name.

3 (Maths) Linear Algebra

Information About Ellipses

Stable Process. 2. Multivariate Stable Distributions. July, 2006

Random vectors X 1 X 2. Recall that a random vector X = is made up of, say, k. X k. random variables.

MAS113 Introduction to Probability and Statistics. Proofs of theorems

Bivariate distributions

A Probability Review

The generative approach to classification. A classification problem. Generative models CSE 250B

Minimum Error Rate Classification

ENGG2430A-Homework 2

[y i α βx i ] 2 (2) Q = i=1

STAT 100C: Linear models

Notes on Random Variables, Expectations, Probability Densities, and Martingales

1.12 Multivariate Random Variables

Methods for sparse analysis of high-dimensional data, II

Physics 403. Segev BenZvi. Parameter Estimation, Correlations, and Error Bars. Department of Physics and Astronomy University of Rochester

Transcription:

The Multivariate Gaussian Distribution Chuong B. Do October, 8 A vector-valued random variable X = T X X n is said to have a multivariate normal or Gaussian) distribution with mean µ R n and covariance matrix Σ S n ++ if its probability density function is given by px;µ, Σ) = exp ) π) n/ Σ / x µ)t Σ x µ). We write this as X Nµ, Σ). In these notes, we describe multivariate Gaussians and some of their basic properties. Relationship to univariate Gaussians Recall that the density function of a univariate normal or Gaussian) distribution is given by px;µ,σ ) = exp ) πσ σx µ). Here, the argument of the exponential function, x µ), is a quadratic function of the σ variable x. Furthermore, the parabola points downwards, as the coefficient of the quadratic term is negative. The coefficient in front, πσ, is a constant that does not depend on x; hence, we can think of it as simply a normalization factor used to ensure that πσ exp σx µ) ) =. Recall from the section notes on linear algebra that S n ++ is the space of symmetric positive definite n n matrices, defined as S n ++ = { A R n n : A = A T and x T Ax > for all x R n such that x }. In these notes, we use the notation p ) to denote density functions, instead of f X ) as in the section notes on probability theory).

.9.8.7..6.5.5..4.5.3.. 3 4 5 6 7 8 9 5 5 5 5 Figure : The figure on the left shows a univariate Gaussian density for a single variable X. The figure on the right shows a multivariate Gaussian density over two variables X and X. In the case of the multivariate Gaussian density, the argument of the exponential function, x µ)t Σ x µ), is a quadratic form in the vector variable x. Since Σ is positive definite, and since the inverse of any positive definite matrix is also positive definite, then for any non-zero vector z, z T Σ z >. This implies that for any vector x µ, x µ) T Σ x µ) > x µ)t Σ x µ) <. Like in the univariate case, you can think of the argument of the exponential function as being a downward opening quadratic bowl. The coefficient in front i.e., ) has an π) n/ Σ / even more complicated form than in the univariate case. However, it still does not depend on x, and hence it is again simply a normalization factor used to ensure that exp ) π) n/ Σ / x µ)t Σ x µ) dx dx dx n =. The covariance matrix The concept of the covariance matrix is vital to understanding multivariate Gaussian distributions. Recall that for a pair of random variables X and Y, their covariance is defined as Cov[X,Y ] = E[X E[X])Y E[Y ])] = E[XY ] E[X]E[Y ]. When working with multiple variables, the covariance matrix provides a succinct way to summarize the covariances of all pairs of variables. In particular, the covariance matrix, which we usually denote as Σ, is the n n matrix whose i,j)th entry is Cov[X i,x j ].

The following proposition whose proof is provided in the Appendix A.) gives an alternative way to characterize the covariance matrix of a random vector X: Proposition. For any random vector X with mean µ and covariance matrix Σ, Σ = E[X µ)x µ) T ] = E[XX T ] µµ T. ) In the definition of multivariate Gaussians, we required that the covariance matrix Σ be symmetric positive definite i.e., Σ S n ++). Why does this restriction exist? As seen in the following proposition, the covariance matrix of any random vector must always be symmetric positive semidefinite: Proposition. Suppose that Σ is the covariance matrix corresponding to some random vector X. Then Σ is symmetric positive semidefinite. Proof. The symmetry of Σ follows immediately from its definition. Next, for any vector z R n, observe that z T Σz = = = i= i= i= = E Σ ij z i z j ) ) j= Cov[X i,x j ] z i z j ) j= E[X i E[X i ])X j E[X j ])] z i z j ) j= [ i= X i E[X i ])X j E[X j ]) z i z j ]. 3) j= Here, ) follows from the formula for expanding a quadratic form see section notes on linear algebra), and 3) follows by linearity of expectations see probability notes). To complete the proof, observe that the quantity inside the brackets is of the form i j x ix j z i z j = x T z) see problem set #). Therefore, the quantity inside the expectation is always nonnegative, and hence the expectation itself must be nonnegative. We conclude that z T Σz. From the above proposition it follows that Σ must be symmetric positive semidefinite in order for it to be a valid covariance matrix. However, in order for Σ to exist as required in the definition of the multivariate Gaussian density), then Σ must be invertible and hence full rank. Since any full rank symmetric positive semidefinite matrix is necessarily symmetric positive definite, it follows that Σ must be symmetric positive definite. 3

3 The diagonal covariance matrix case To get an intuition for what a multivariate Gaussian is, consider the simple case where n =, and where the covariance matrix Σ is diagonal, i.e., x µ σ x = µ = Σ = x µ σ In this case, the multivariate Gaussian density has the form, px;µ, Σ) = π σ exp T x µ σ ) x µ / x µ σ x µ σ = exp [ T ] [x ] x µ ) σ µ πσ σ, ) / x µ x µ σ where we have relied on the explicit formula for the determinant of a matrix 3, and the fact that the inverse of a diagonal matrix is simply found by taking the reciprocal of each diagonal entry. Continuing, [ T ]) x µ px;µ, Σ) = = = πσ σ exp exp πσ σ exp πσ x µ x σ µ ) ) x σ µ ) σ x µ ) σ x µ ) σ x µ ) ) πσ exp x σ µ ) ). The last equation we recognize to simply be the product of two independent Gaussian densities, one with mean µ and variance σ, and the other with mean µ and variance σ. More generally, one can show that an n-dimensional Gaussian with mean µ R n and diagonal covariance matrix Σ = diagσ,σ,...,σ n) is the same as a collection of n independent Gaussian random variables with mean µ i and variance σ i, respectively. 4 Isocontours Another way to understand a multivariate Gaussian conceptually is to understand the shape of its isocontours. For a function f : R R, an isocontour is a set of the form { x R : fx) = c }. for some c R. 4 3 Namely, a b c d = ad bc. 4 Isocontours are often also known as level curves. More generally, a level set of a function f : R n R, is a set of the form { x R : fx) = c } for some c R. 4

4. Shape of isocontours What do the isocontours of a multivariate Gaussian look like? As before, let s consider the case where n =, and Σ is diagonal, i.e., x µ σ x = µ = Σ = x µ σ As we showed in the last section, px;µ, Σ) = exp x πσ σ σ µ ) x σ µ ) ). 4) Now, let s consider the level set consisting of all points where px;µ, Σ) = c for some constant c R. In particular, consider the set of all x,x R such that c = exp x πσ σ σ µ ) ) x σ µ ) πcσ σ = exp x σ µ ) ) x σ µ ) logπcσ σ ) = x σ µ ) x σ µ ) ) log = x πcσ σ σ µ ) + x σ µ ) x µ ) x = ) µ ) + ). σ log πcσ σ σ log πcσ σ Defining ) r = σ log πcσ σ ) r = σ log, πcσ σ it follows that ) ) x µ x µ = +. 5) r Equation 5) should be familiar to you from high school analytic geometry: it is the equation of an axis-aligned ellipse, with center µ,µ ), where the x axis has length r and the x axis has length r! 4. Length of axes To get a better understanding of how the shape of the level curves vary as a function of the variances of the multivariate Gaussian distribution, suppose that we are interested in 5 r

8 8 6 6 4 4 4 6 6 4 4 6 8 4 4 4 6 8 Figure : The figure on the left shows a heatmap indicating values of the density function for an 3 axis-aligned multivariate Gaussian with mean µ = and diagonal covariance matrix Σ = 5. Notice that the Gaussian is centered at 3, ), and that the isocontours are all 9 elliptically shaped with major/minor axis lengths in a 5:3 ratio. The figure on the right shows a heatmap indicating[ values ] of the density function for[ a non] axis-aligned multivariate 3 5 Gaussian with mean µ = and covariance matrix Σ =. Here, the ellipses are 5 5 again centered at 3, ), but now the major and minor axes have been rotated via a linear transformation. 6

the values of r and r at which c is equal to a fraction /e of the peak height of Gaussian density. First, observe that maximum of Equation 4) occurs where x = µ and x = µ. Substituting these values into Equation 4), we see that the peak height of the Gaussian density is πσ σ. ) Second, we substitute c = e πσ σ into the equations for r and r to obtain r = σ log r = σ log πσ σ e πσ σ e ) πσ σ ) πσ σ = σ = σ. From this, it follows that the axis length needed to reach a fraction /e of the peak height of the Gaussian density in the ith dimension grows in proportion to the standard deviation σ i. Intuitively, this again makes sense: the smaller the variance of some random variable x i, the more tightly peaked the Gaussian distribution in that dimension, and hence the smaller the radius r i. 4.3 Non-diagonal case, higher dimensions Clearly, the above derivations rely on the assumption that Σ is a diagonal matrix. However, in the non-diagonal case, it turns out that the picture is not all that different. Instead of being an axis-aligned ellipse, the isocontours turn out to be simply rotated ellipses. Furthermore, in the n-dimensional case, the level sets form geometrical structures known as ellipsoids in R n. 5 Linear transformation interpretation In the last few sections, we focused primarily on providing an intuition for how multivariate Gaussians with diagonal covariance matrices behaved. In particular, we found that an n- dimensional multivariate Gaussian with diagonal covariance matrix could be viewed simply as a collection of n independent Gaussian-distributed random variables with means and variances µ i and σ i, respectvely. In this section, we dig a little deeper and provide a quantitative interpretation of multivariate Gaussians when the covariance matrix is not diagonal. The key result of this section is the following theorem see proof in Appendix A.). Theorem. Let X Nµ, Σ) for some µ R n and Σ S n ++. Then, there exists a matrix B R n n such that if we define Z = B X µ), then Z N,I). 7

To understand the meaning of this theorem, note that if Z N,I), then using the analysis from Section 4, Z can be thought of as a collection of n independent standard normal random variables i.e., Z i N, )). Furthermore, if Z = B X µ) then X = BZ + µ follows from simple algebra. Consequently, the theorem states that any random variable X with a multivariate Gaussian distribution can be interpreted as the result of applying a linear transformation X = BZ + µ) to some collection of n independent standard normal random variables Z). 8

Appendix A. Proof. We prove the first of the two equalities in ); the proof of the other equality is similar. Cov[X,X ] Cov[X,X n ] Σ =..... Cov[X n,x ] Cov[X n,x n ] E[X µ ) ] E[X µ )X n µ n )] =..... E[X n µ n )X µ )] E[X n µ n ) ] X µ ) X µ )X n µ n ) = E..... 6) X n µ n )X µ ) X n µ n ) X µ = E. X µ X n µ n 7) X n µ n = E [ X µ)x µ) T]. Here, 6) follows from the fact that the expectation of a matrix is simply the matrix found by taking the componentwise expectation of each entry. Also, 7) follows from the fact that for any vector z R n, z z z z z z z n zz T z z z z z z z n = z z z n =........ z n z z n z z n z n z n Appendix A. We restate the theorem below: Theorem. Let X Nµ, Σ) for some µ R n and Σ S n ++. Then, there exists a matrix B R n n such that if we define Z = B X µ), then Z N,I). The derivation of this theorem requires some advanced linear algebra and probability theory and can be skipped for the purposes of this class. Our argument will consist of two parts. First, we will show that the covariance matrix Σ can be factorized as Σ = BB T for some invertible matrix B. Second, we will perform a change-of-variable from X to a different vector valued random variable Z using the relation Z = B X µ). 9

Step : Factorizing the covariance matrix. Recall the following two properties of symmetric matrices from the notes on linear algebra 5 :. Any real symmetric matrix A R n n can always be represented as A = UΛU T, where U is a full rank orthogonal matrix containing of the eigenvectors of A as its columns, and Λ is a diagonal matrix containing A s eigenvalues.. If A is symmetric positive definite, all its eigenvalues are positive. Since the covariance matrix Σ is positive definite, using the first fact, we can write Σ = UΛU T for some appropriately defined matrices U and Λ. Using the second fact, we can define Λ / R n n to be the diagonal matrix whose entries are the square roots of the corresponding entries from Λ. Since Λ = Λ / Λ / ) T, we have Σ = UΛU T = UΛ / Λ / ) T U T = UΛ / UΛ / ) T = BB T, where B = UΛ /. 6 In this case, then Σ = B T B, so we can rewrite the standard formula for the density of a multivariate Gaussian as px;µ, Σ) = exp ) π) n/ BB T / x µ)t B T B x µ). 8) Step : Change of variables. Now, define the vector-valued random variable Z = B X µ). A basic formula of probability theory, which we did not introduce in the section notes on probability theory, is the change-of-variables formula for relating vector-valued random variables: Suppose that X = T X X n R n is a vector-valued random variable with joint density function f X : R n R. If Z = HX) R n where H is a bijective, differentiable function, then Z has joint density f Z : R n R, where x x z z n f Z z) = f X x) det...... x n x z n z n Using the change-of-variable formula, one can show after some algebra, which we ll skip) that the vector variable Z has the following joint density: p Z z) = exp ) π) n/ zt z. 9) The claim follows immediately. 5 See section on Eigenvalues and Eigenvectors of Symmetric Matrices. 6 To show that B is invertible, it suffices to observe that U is an invertible matrix, and right-multiplying U by a diagonal matrix with no zero diagonal entries) will rescale its columns but will not change its rank.