Covariance matrix







A bivariate Gaussian probability density function centered at (0, 0), with covariance matrix given by [10.50.51]{displaystyle {begin{bmatrix}1&0.5\0.5&1end{bmatrix}}}{displaystyle {begin{bmatrix}1&0.5\0.5&1end{bmatrix}}}




Sample points from a bivariate Gaussian distribution with a standard deviation of 3 in roughly the lower left-upper right direction and of 1 in the orthogonal direction. Because the x and y components co-vary, the variances of x and y do not fully describe the distribution. A 2×2 covariance matrix is needed; the directions of the arrows correspond to the eigenvectors of this covariance matrix and their lengths to the square roots of the eigenvalues.


In probability theory and statistics, a covariance matrix (also known as dispersion matrix or variance–covariance matrix) is a matrix whose element in the i, j position is the covariance between the i-th and j-th elements of a random vector. A random vector is a random variable with multiple dimensions. Each element of the vector is a scalar random variable. Each element has either a finite number of observed empirical values or a finite or infinite number of potential values. The potential values are specified by a theoretical joint probability distribution.


Intuitively, the covariance matrix generalizes the notion of variance to multiple dimensions. As an example, the variation in a collection of random points in two-dimensional space cannot be characterized fully by a single number, nor would the variances in the x and y directions contain all of the necessary information; a 2×2 matrix would be necessary to fully characterize the two-dimensional variation.


Because the covariance of the i-th random variable with itself is simply that random variable's variance, each element on the principal diagonal of the covariance matrix is the variance of one of the random variables. Because the covariance of the i-th random variable with the j-th one is the same thing as the covariance of the j-th random variable with the i-th one, every covariance matrix is symmetric. In addition, every covariance matrix is positive semi-definite.




Contents






  • 1 Definition


    • 1.1 Generalization of the variance


    • 1.2 Correlation matrix


    • 1.3 Conflicting nomenclatures and notations




  • 2 Properties


    • 2.1 Basic properties


    • 2.2 Block matrices




  • 3 Covariance matrix as a parameter of a distribution


  • 4 Covariance matrix as a linear operator


  • 5 Which matrices are covariance matrices?


  • 6 Complex random vectors


  • 7 Estimation


  • 8 Applications


  • 9 See also


  • 10 References


  • 11 Further reading





Definition


Throughout this article, boldfaced unsubscripted X{displaystyle mathbf {X} }mathbf {X} and Y{displaystyle mathbf {Y} }mathbf {Y} are used to refer to random vectors, and unboldfaced subscripted Xi{displaystyle X_{i}}X_{i} and Yi{displaystyle Y_{i}}Y_{i} are used to refer to scalar random variables.


If the entries in the column vector


X=[X1⋮Xn]{displaystyle mathbf {X} ={begin{bmatrix}X_{1}\vdots \X_{n}end{bmatrix}}}{displaystyle mathbf {X} ={begin{bmatrix}X_{1}\vdots \X_{n}end{bmatrix}}}

are random variables, each with finite variance, then the covariance matrix Σ{displaystyle Sigma }Sigma is the matrix whose (i,j){displaystyle (i,j)}(i,j) entry is the covariance


Σij=cov⁡(Xi,Xj)=E⁡[(Xi−μi)(Xj−μj)]=E⁡[XiXj]−μj,{displaystyle Sigma _{ij}=operatorname {cov} (X_{i},X_{j})=operatorname {E} [(X_{i}-mu _{i})(X_{j}-mu _{j})]=operatorname {E} [X_{i}X_{j}]-mu _{i}mu _{j},}{displaystyle Sigma _{ij}=operatorname {cov} (X_{i},X_{j})=operatorname {E} [(X_{i}-mu _{i})(X_{j}-mu _{j})]=operatorname {E} [X_{i}X_{j}]-mu _{i}mu _{j},}

where the operator E{displaystyle operatorname {E} }operatorname {E} denotes the expected value (mean) of its argument, and


μi=E⁡(Xi){displaystyle mu _{i}=operatorname {E} (X_{i})}{displaystyle mu _{i}=operatorname {E} (X_{i})}

is the expected value of the i-th entry in the vector X{displaystyle mathbf {X} }mathbf {X} . In other words,


Σ=[E⁡[(X1−μ1)(X1−μ1)]E⁡[(X1−μ1)(X2−μ2)]⋯E⁡[(X1−μ1)(Xn−μn)]E⁡[(X2−μ2)(X1−μ1)]E⁡[(X2−μ2)(X2−μ2)]⋯E⁡[(X2−μ2)(Xn−μn)]⋮E⁡[(Xn−μn)(X1−μ1)]E⁡[(Xn−μn)(X2−μ2)]⋯E⁡[(Xn−μn)(Xn−μn)]].{displaystyle Sigma ={begin{bmatrix}operatorname {E} [(X_{1}-mu _{1})(X_{1}-mu _{1})]&operatorname {E} [(X_{1}-mu _{1})(X_{2}-mu _{2})]&cdots &operatorname {E} [(X_{1}-mu _{1})(X_{n}-mu _{n})]\\operatorname {E} [(X_{2}-mu _{2})(X_{1}-mu _{1})]&operatorname {E} [(X_{2}-mu _{2})(X_{2}-mu _{2})]&cdots &operatorname {E} [(X_{2}-mu _{2})(X_{n}-mu _{n})]\\vdots &vdots &ddots &vdots \\operatorname {E} [(X_{n}-mu _{n})(X_{1}-mu _{1})]&operatorname {E} [(X_{n}-mu _{n})(X_{2}-mu _{2})]&cdots &operatorname {E} [(X_{n}-mu _{n})(X_{n}-mu _{n})]end{bmatrix}}.}{displaystyle Sigma ={begin{bmatrix}operatorname {E} [(X_{1}-mu _{1})(X_{1}-mu _{1})]&operatorname {E} [(X_{1}-mu _{1})(X_{2}-mu _{2})]&cdots &operatorname {E} [(X_{1}-mu _{1})(X_{n}-mu _{n})]\\operatorname {E} [(X_{2}-mu _{2})(X_{1}-mu _{1})]&operatorname {E} [(X_{2}-mu _{2})(X_{2}-mu _{2})]&cdots &operatorname {E} [(X_{2}-mu _{2})(X_{n}-mu _{n})]\\vdots &vdots &ddots &vdots \\operatorname {E} [(X_{n}-mu _{n})(X_{1}-mu _{1})]&operatorname {E} [(X_{n}-mu _{n})(X_{2}-mu _{2})]&cdots &operatorname {E} [(X_{n}-mu _{n})(X_{n}-mu _{n})]end{bmatrix}}.}

The inverse of this matrix, Σ1{displaystyle Sigma ^{-1}}Sigma ^{-1}, if it exists, is the inverse covariance matrix, also known as the concentration matrix or precision matrix.[1]



Generalization of the variance


The definition above is equivalent to the matrix equality


Σ=E⁡[(X−E⁡[X])(X−E⁡[X])T].{displaystyle Sigma =operatorname {E} left[(mathbf {X} -operatorname {E} [mathbf {X} ])(mathbf {X} -operatorname {E} [mathbf {X} ])^{rm {T}}right].}{displaystyle Sigma =operatorname {E} left[(mathbf {X} -operatorname {E} [mathbf {X} ])(mathbf {X} -operatorname {E} [mathbf {X} ])^{rm {T}}right].}

This form can be seen as a generalization of the scalar-valued variance to higher dimensions. Recall that for a scalar-valued random variable X


σ2=var⁡(X)=E⁡[(X−E⁡(X))2]=E⁡[(X−E⁡(X))⋅(X−E⁡(X))].{displaystyle sigma ^{2}=operatorname {var} (X)=operatorname {E} [(X-operatorname {E} (X))^{2}]=operatorname {E} [(X-operatorname {E} (X))cdot (X-operatorname {E} (X))].}{displaystyle sigma ^{2}=operatorname {var} (X)=operatorname {E} [(X-operatorname {E} (X))^{2}]=operatorname {E} [(X-operatorname {E} (X))cdot (X-operatorname {E} (X))].}

Indeed, the entries on the diagonal of the covariance matrix Σ{displaystyle Sigma }Sigma are the variances of each element of the vector X{displaystyle mathbf {X} }mathbf {X} .



Correlation matrix


An entity closely related to the covariance matrix is the correlation matrix, the matrix of Pearson product-moment correlation coefficients between each of the random variables in the random vector X{displaystyle mathbf {X} }mathbf {X} , which can be written as


corr⁡(X)=(diag⁡))−12Σ(diag⁡))−12,{displaystyle operatorname {corr} (mathbf {X} )={big (}operatorname {diag} (Sigma ){big )}^{-{frac {1}{2}}},Sigma ,{big (}operatorname {diag} (Sigma ){big )}^{-{frac {1}{2}}},}{displaystyle operatorname {corr} (mathbf {X} )={big (}operatorname {diag} (Sigma ){big )}^{-{frac {1}{2}}},Sigma ,{big (}operatorname {diag} (Sigma ){big )}^{-{frac {1}{2}}},}

where diag⁡){displaystyle operatorname {diag} (Sigma )}{displaystyle operatorname {diag} (Sigma )} is the matrix of the diagonal elements of Σ{displaystyle Sigma }Sigma (i.e., a diagonal matrix of the variances of Xi{displaystyle X_{i}}X_{i} for i=1,…,n{displaystyle i=1,dots ,n}i=1,dots ,n).


Equivalently, the correlation matrix can be seen as the covariance matrix of the standardized random variables Xi/σ(Xi){displaystyle X_{i}/sigma (X_{i})}X_{i}/sigma (X_{i}) for i=1,…,n{displaystyle i=1,dots ,n}i=1,dots ,n.


Each element on the principal diagonal of a correlation matrix is the correlation of a random variable with itself, which always equals 1. Each off-diagonal element is between −1 and +1 inclusive.



Conflicting nomenclatures and notations


Nomenclatures differ. Some statisticians, following the probabilist William Feller in his two-volume book An Introduction to Probability Theory and Its Applications,[2] call the matrix Σ{displaystyle Sigma }Sigma the variance of the random vector X{displaystyle X}X, because it is the natural generalization to higher dimensions of the 1-dimensional variance. Others call it the covariance matrix, because it is the matrix of covariances between the scalar components of the vector X{displaystyle X}X.


var⁡(X)=cov⁡(X)=E⁡[(X−E⁡[X])(X−E⁡[X])T].{displaystyle operatorname {var} (mathbf {X} )=operatorname {cov} (mathbf {X} )=operatorname {E} left[(mathbf {X} -operatorname {E} [mathbf {X} ])(mathbf {X} -operatorname {E} [mathbf {X} ])^{rm {T}}right].}{displaystyle operatorname {var} (mathbf {X} )=operatorname {cov} (mathbf {X} )=operatorname {E} left[(mathbf {X} -operatorname {E} [mathbf {X} ])(mathbf {X} -operatorname {E} [mathbf {X} ])^{rm {T}}right].}

Both forms are quite standard, and there is no ambiguity between them. The matrix Σ{displaystyle Sigma }Sigma is also often called the variance-covariance matrix, since the diagonal terms are in fact variances.


By comparison, the notation for the cross-covariance between two vectors is


cov⁡(X,Y)=CX,Y=E⁡[(X−E⁡[X])(Y−E⁡[Y])T].{displaystyle operatorname {cov} (mathbf {X} ,mathbf {Y} )=C_{mathbf {X} ,mathbf {Y} }=operatorname {E} left[(mathbf {X} -operatorname {E} [mathbf {X} ])(mathbf {Y} -operatorname {E} [mathbf {Y} ])^{rm {T}}right].}{displaystyle operatorname {cov} (mathbf {X} ,mathbf {Y} )=C_{mathbf {X} ,mathbf {Y} }=operatorname {E} left[(mathbf {X} -operatorname {E} [mathbf {X} ])(mathbf {Y} -operatorname {E} [mathbf {Y} ])^{rm {T}}right].}


Properties



Basic properties


For Σ=var⁡(X)=E⁡[(X−E⁡[X])(X−E⁡[X])T]{displaystyle Sigma =operatorname {var} (mathbf {X} )=operatorname {E} left[left(mathbf {X} -operatorname {E} [mathbf {X} ]right)left(mathbf {X} -operatorname {E} [mathbf {X} ]right)^{rm {T}}right]}{displaystyle Sigma =operatorname {var} (mathbf {X} )=operatorname {E} left[left(mathbf {X} -operatorname {E} [mathbf {X} ]right)left(mathbf {X} -operatorname {E} [mathbf {X} ]right)^{rm {T}}right]} and μ=E⁡(X){displaystyle {boldsymbol {mu }}=operatorname {E} ({textbf {X}})}{displaystyle {boldsymbol {mu }}=operatorname {E} ({textbf {X}})}, where X{displaystyle mathbf {X} }mathbf {X} is a p{displaystyle p}p-dimensional random variable, the following basic properties apply:[3]



  1. Σ=E⁡(XXT)−μμT{displaystyle Sigma =operatorname {E} (mathbf {XX^{rm {T}}} )-{boldsymbol {mu }}{boldsymbol {mu }}^{rm {T}}}{displaystyle Sigma =operatorname {E} (mathbf {XX^{rm {T}}} )-{boldsymbol {mu }}{boldsymbol {mu }}^{rm {T}}}


  2. Σ{displaystyle Sigma ,}Sigma , is positive-semidefinite and symmetric

  3. var⁡(AX+a)=Avar⁡(X)AT{displaystyle operatorname {var} (mathbf {AX} +mathbf {a} )=mathbf {A} ,operatorname {var} (mathbf {X} ),mathbf {A^{rm {T}}} }{displaystyle operatorname {var} (mathbf {AX} +mathbf {a} )=mathbf {A} ,operatorname {var} (mathbf {X} ),mathbf {A^{rm {T}}} }

  4. If Y{displaystyle mathbf {Y} }mathbf {Y} is another random vector with the same dimension as X{displaystyle mathbf {X} }mathbf {X} , then var⁡(X+Y)=var⁡(X)+cov⁡(X,Y)+cov⁡(Y,X)+var⁡(Y){displaystyle operatorname {var} (mathbf {X} +mathbf {Y} )=operatorname {var} (mathbf {X} )+operatorname {cov} (mathbf {X} ,mathbf {Y} )+operatorname {cov} (mathbf {Y} ,mathbf {X} )+operatorname {var} (mathbf {Y} )}{displaystyle operatorname {var} (mathbf {X} +mathbf {Y} )=operatorname {var} (mathbf {X} )+operatorname {cov} (mathbf {X} ,mathbf {Y} )+operatorname {cov} (mathbf {Y} ,mathbf {X} )+operatorname {var} (mathbf {Y} )}


where a{displaystyle mathbf {a} }mathbf {a} is a 1{displaystyle ptimes 1}ptimes 1 constant vector, A{displaystyle mathbf {A} }mathbf {A} is a p{displaystyle ptimes p}ptimes p matrix of constants, and cov⁡(X,Y){displaystyle operatorname {cov} (mathbf {X} ,mathbf {Y} )}{displaystyle operatorname {cov} (mathbf {X} ,mathbf {Y} )} is the cross-covariance matrix of X{displaystyle mathbf {X} }mathbf {X} and Y{displaystyle mathbf {Y} }mathbf {Y} .



Block matrices


The joint mean μX,Y{displaystyle {boldsymbol {mu }}_{X,Y}}{boldsymbol {mu }}_{X,Y} and joint covariance matrix ΣX,Y{displaystyle {boldsymbol {Sigma }}_{X,Y}}{boldsymbol {Sigma }}_{X,Y} of X{displaystyle {boldsymbol {X}}}{boldsymbol {X}} and Y{displaystyle {boldsymbol {Y}}}{boldsymbol {Y}} can be written in block form


μX,Y=[μY],ΣX,Y=[ΣXXΣXYΣYXΣYY]{displaystyle {boldsymbol {mu }}_{X,Y}={begin{bmatrix}{boldsymbol {mu }}_{X}\{boldsymbol {mu }}_{Y}end{bmatrix}},qquad {boldsymbol {Sigma }}_{X,Y}={begin{bmatrix}{boldsymbol {Sigma }}_{mathit {XX}}&{boldsymbol {Sigma }}_{mathit {XY}}\{boldsymbol {Sigma }}_{mathit {YX}}&{boldsymbol {Sigma }}_{mathit {YY}}end{bmatrix}}}{boldsymbol {mu }}_{X,Y}={begin{bmatrix}{boldsymbol {mu }}_{X}\{boldsymbol {mu }}_{Y}end{bmatrix}},qquad {boldsymbol {Sigma }}_{X,Y}={begin{bmatrix}{boldsymbol {Sigma }}_{mathit {XX}}&{boldsymbol {Sigma }}_{mathit {XY}}\{boldsymbol {Sigma }}_{mathit {YX}}&{boldsymbol {Sigma }}_{mathit {YY}}end{bmatrix}}

where ΣXX=var⁡(X),ΣYY=var⁡(Y),{displaystyle {boldsymbol {Sigma }}_{XX}=operatorname {var} ({boldsymbol {X}}),{boldsymbol {Sigma }}_{YY}=operatorname {var} ({boldsymbol {Y}}),}{displaystyle {boldsymbol {Sigma }}_{XX}=operatorname {var} ({boldsymbol {X}}),{boldsymbol {Sigma }}_{YY}=operatorname {var} ({boldsymbol {Y}}),} and ΣXY=ΣYXT=cov⁡(X,Y){displaystyle {boldsymbol {Sigma }}_{XY}={boldsymbol {Sigma }}_{mathit {YX}}^{T}=operatorname {cov} ({boldsymbol {X}},{boldsymbol {Y}})}{displaystyle {boldsymbol {Sigma }}_{XY}={boldsymbol {Sigma }}_{mathit {YX}}^{T}=operatorname {cov} ({boldsymbol {X}},{boldsymbol {Y}})}.


ΣXX{displaystyle {boldsymbol {Sigma }}_{XX}}{boldsymbol {Sigma }}_{XX} and ΣYY{displaystyle {boldsymbol {Sigma }}_{YY}}{boldsymbol {Sigma }}_{YY} can be identified as the variance matrices of the marginal distributions for X{displaystyle {boldsymbol {X}}}{boldsymbol {X}} and Y{displaystyle {boldsymbol {Y}}}{boldsymbol {Y}} respectively.


If X{displaystyle {boldsymbol {X}}}{boldsymbol {X}} and Y{displaystyle {boldsymbol {Y}}}{boldsymbol {Y}} are jointly normally distributed,



X,Y∼ N(μX,Y,ΣX,Y){displaystyle {boldsymbol {X}},{boldsymbol {Y}}sim {mathcal {N}}({boldsymbol {mu }}_{X,Y},{boldsymbol {Sigma }}_{X,Y})}{displaystyle {boldsymbol {X}},{boldsymbol {Y}}sim  {mathcal {N}}({boldsymbol {mu }}_{X,Y},{boldsymbol {Sigma }}_{X,Y})},

then the conditional distribution for Y{displaystyle {boldsymbol {Y}}}{boldsymbol {Y}} given X{displaystyle {boldsymbol {X}}}{boldsymbol {X}} is given by



Y|X∼ N(μY|X,ΣY|X){displaystyle {boldsymbol {Y}}|{boldsymbol {X}}sim {mathcal {N}}({boldsymbol {mu }}_{Y|X},{boldsymbol {Sigma }}_{Y|X})}{displaystyle {boldsymbol {Y}}|{boldsymbol {X}}sim  {mathcal {N}}({boldsymbol {mu }}_{Y|X},{boldsymbol {Sigma }}_{Y|X})},[4]

defined by conditional mean


μY|X=μY+ΣYXΣXX−1(x−μX){displaystyle {boldsymbol {mu }}_{Y|X}={boldsymbol {mu }}_{Y}+{boldsymbol {Sigma }}_{YX}{boldsymbol {Sigma }}_{XX}^{-1}left(mathbf {x} -{boldsymbol {mu }}_{X}right)}{boldsymbol {mu }}_{Y|X}={boldsymbol {mu }}_{Y}+{boldsymbol {Sigma }}_{YX}{boldsymbol {Sigma }}_{XX}^{-1}left(mathbf {x} -{boldsymbol {mu }}_{X}right)

and conditional variance


ΣY|X=ΣYY−ΣYXΣXX−XY.{displaystyle {boldsymbol {Sigma }}_{Y|X}={boldsymbol {Sigma }}_{YY}-{boldsymbol {Sigma }}_{mathit {YX}}{boldsymbol {Sigma }}_{mathit {XX}}^{-1}{boldsymbol {Sigma }}_{mathit {XY}}.}{boldsymbol {Sigma }}_{Y|X}={boldsymbol {Sigma }}_{YY}-{boldsymbol {Sigma }}_{mathit {YX}}{boldsymbol {Sigma }}_{mathit {XX}}^{-1}{boldsymbol {Sigma }}_{mathit {XY}}.

The matrix ΣYXΣXX−1{displaystyle {boldsymbol {Sigma }}_{YX}{boldsymbol {Sigma }}_{XX}^{-1}}{displaystyle {boldsymbol {Sigma }}_{YX}{boldsymbol {Sigma }}_{XX}^{-1}} is known as the matrix of regression coefficients, while in linear algebra ΣY|X{displaystyle {boldsymbol {Sigma }}_{Y|X}}{displaystyle {boldsymbol {Sigma }}_{Y|X}} is the Schur complement of ΣXX{displaystyle {boldsymbol {Sigma }}_{XX}}{boldsymbol {Sigma }}_{XX} in ΣX,Y{displaystyle {boldsymbol {Sigma }}_{X,Y}}{boldsymbol {Sigma }}_{X,Y}.


The matrix of regression coefficients may often be given in transpose form, ΣXX−XY{displaystyle {boldsymbol {Sigma }}_{XX}^{-1}{boldsymbol {Sigma }}_{XY}}{displaystyle {boldsymbol {Sigma }}_{XX}^{-1}{boldsymbol {Sigma }}_{XY}}, suitable for post-multiplying a row vector of explanatory variables xT rather than pre-multiplying a column vector x. In this form they correspond to the coefficients obtained by inverting the matrix of the normal equations of ordinary least squares (OLS).



Covariance matrix as a parameter of a distribution


If a vector of n possibly correlated random variables is jointly normally distributed, or more generally elliptically distributed, then its probability density function can be expressed in terms of the covariance matrix.[5]



Covariance matrix as a linear operator



Applied to one vector, the covariance matrix maps a linear combination c of the random variables X onto a vector of covariances with those variables: cTΣ=cov⁡(cTX,X){displaystyle mathbf {c} ^{rm {T}}Sigma =operatorname {cov} (mathbf {c} ^{rm {T}}mathbf {X} ,mathbf {X} )}{displaystyle mathbf {c} ^{rm {T}}Sigma =operatorname {cov} (mathbf {c} ^{rm {T}}mathbf {X} ,mathbf {X} )}. Treated as a bilinear form, it yields the covariance between the two linear combinations: dTΣc=cov⁡(dTX,cTX){displaystyle mathbf {d} ^{rm {T}}Sigma mathbf {c} =operatorname {cov} (mathbf {d} ^{rm {T}}mathbf {X} ,mathbf {c} ^{rm {T}}mathbf {X} )}{displaystyle mathbf {d} ^{rm {T}}Sigma mathbf {c} =operatorname {cov} (mathbf {d} ^{rm {T}}mathbf {X} ,mathbf {c} ^{rm {T}}mathbf {X} )}. The variance of a linear combination is then cTΣc{displaystyle mathbf {c} ^{rm {T}}Sigma mathbf {c} }{displaystyle mathbf {c} ^{rm {T}}Sigma mathbf {c} }, its covariance with itself.


Similarly, the (pseudo-)inverse covariance matrix provides an inner product c−μ+|c−μ{displaystyle langle c-mu |Sigma ^{+}|c-mu rangle }{displaystyle langle c-mu |Sigma ^{+}|c-mu rangle }, which induces the Mahalanobis distance, a measure of the "unlikelihood" of c.[citation needed]



Which matrices are covariance matrices?


From the identity just above, let b{displaystyle mathbf {b} }mathbf {b} be a (p×1){displaystyle (ptimes 1)}(ptimes 1) real-valued vector, then


var⁡(bTX)=bTvar⁡(X)b,{displaystyle operatorname {var} (mathbf {b} ^{rm {T}}mathbf {X} )=mathbf {b} ^{rm {T}}operatorname {var} (mathbf {X} )mathbf {b} ,,}operatorname {var} (mathbf {b} ^{rm {T}}mathbf {X} )=mathbf {b} ^{rm {T}}operatorname {var} (mathbf {X} )mathbf {b} ,,

which must always be nonnegative, since it is the variance of a real-valued random variable. A covariance matrix is always a positive-semidefinite matrix, since



wTE⁡[(X−E⁡[X])(X−E⁡[X])T]w=E⁡[wT(X−E⁡[X])(X−E⁡[X])Tw]=E⁡[(wT(X−E⁡[X]))2]≥0{displaystyle w^{rm {T}}operatorname {E} left[(mathbf {X} -operatorname {E} [mathbf {X} ])(mathbf {X} -operatorname {E} [mathbf {X} ])^{rm {T}}right]w=operatorname {E} left[w^{rm {T}}(mathbf {X} -operatorname {E} [mathbf {X} ])(mathbf {X} -operatorname {E} [mathbf {X} ])^{rm {T}}wright]=operatorname {E} left[(w^{rm {T}}(mathbf {X} -operatorname {E} [mathbf {X} ]))^{2}right]geq 0}{displaystyle w^{rm {T}}operatorname {E} left[(mathbf {X} -operatorname {E} [mathbf {X} ])(mathbf {X} -operatorname {E} [mathbf {X} ])^{rm {T}}right]w=operatorname {E} left[w^{rm {T}}(mathbf {X} -operatorname {E} [mathbf {X} ])(mathbf {X} -operatorname {E} [mathbf {X} ])^{rm {T}}wright]=operatorname {E} left[(w^{rm {T}}(mathbf {X} -operatorname {E} [mathbf {X} ]))^{2}right]geq 0}.

Conversely, every symmetric positive semi-definite matrix is a covariance matrix. To see this, suppose M is a p×p positive-semidefinite matrix. From the finite-dimensional case of the spectral theorem, it follows that M has a nonnegative symmetric square root, which can be denoted by M1/2. Let X{displaystyle mathbf {X} }mathbf {X} be any p×1 column vector-valued random variable whose covariance matrix is the p×p identity matrix. Then


var⁡(M1/2X)=M1/2var⁡(X)M1/2=M.{displaystyle operatorname {var} (mathbf {M} ^{1/2}mathbf {X} )=mathbf {M} ^{1/2},operatorname {var} (mathbf {X} ),mathbf {M} ^{1/2}=mathbf {M} .}{displaystyle operatorname {var} (mathbf {M} ^{1/2}mathbf {X} )=mathbf {M} ^{1/2},operatorname {var} (mathbf {X} ),mathbf {M} ^{1/2}=mathbf {M} .}


Complex random vectors



The variance of a complex scalar-valued random variable with expected value μ is conventionally defined using complex conjugation:


var⁡(Z)=E⁡[(Z−μ)(Z−μ)∗],{displaystyle operatorname {var} (mathbf {Z} )=operatorname {E} [(mathbf {Z} -mathbf {mu } )(mathbf {Z} -mathbf {mu } )^{*}],}{displaystyle operatorname {var} (mathbf {Z} )=operatorname {E} [(mathbf {Z} -mathbf {mu } )(mathbf {Z} -mathbf {mu } )^{*}],}

where the complex conjugate of a complex number z{displaystyle z}z is denoted z∗{displaystyle z^{*}}z^{*}; thus the variance of a complex number is a real number.


If Z{displaystyle mathbf {Z} }mathbf {Z} is a column vector of complex-valued random variables, then the conjugate transpose is formed by both transposing and conjugating. In the following expression, the product of a vector with its conjugate transpose results in a square matrix, as its expectation:


E⁡[(Z−μ)(Z−μ)†],{displaystyle operatorname {E} left[(mathbf {Z} -mathbf {mu } )(mathbf {Z} -mathbf {mu } )^{dagger }right],}{displaystyle operatorname {E} left[(mathbf {Z} -mathbf {mu } )(mathbf {Z} -mathbf {mu } )^{dagger }right],}

where Z†{displaystyle mathbf {Z} ^{dagger }}{displaystyle mathbf {Z} ^{dagger }} denotes the conjugate transpose, which is applicable to the scalar case, since the transpose of a scalar is still a scalar. The matrix so obtained will be Hermitian positive-semidefinite,[6] with real numbers in the main diagonal and complex numbers off-diagonal.



Estimation



If MX{displaystyle mathbf {M} _{mathbf {X} }}mathbf {M} _{mathbf {X} } and MY{displaystyle mathbf {M} _{mathbf {Y} }}mathbf {M} _{mathbf {Y} } are centred data matrices of dimension n×p and n×q respectively, i.e. with n rows of observations of p and q columns of variables, from which the column means have been subtracted, then, if the column means were estimated from the data, sample correlation matrices QX{displaystyle mathbf {Q} _{mathbf {X} }}mathbf {Q} _{mathbf {X} } and QXY{displaystyle mathbf {Q} _{mathbf {XY} }}mathbf {Q} _{mathbf {XY} } can be defined to be


QX=1n−1MXTMX,QXY=1n−1MXTMY{displaystyle mathbf {Q} _{mathbf {X} }={frac {1}{n-1}}mathbf {M} _{mathbf {X} }^{rm {T}}mathbf {M} _{mathbf {X} },qquad mathbf {Q} _{mathbf {XY} }={frac {1}{n-1}}mathbf {M} _{mathbf {X} }^{rm {T}}mathbf {M} _{mathbf {Y} }}{displaystyle mathbf {Q} _{mathbf {X} }={frac {1}{n-1}}mathbf {M} _{mathbf {X} }^{rm {T}}mathbf {M} _{mathbf {X} },qquad mathbf {Q} _{mathbf {XY} }={frac {1}{n-1}}mathbf {M} _{mathbf {X} }^{rm {T}}mathbf {M} _{mathbf {Y} }}

or, if the column means were known a priori,


QX=1nMXTMX,QXY=1nMXTMY.{displaystyle mathbf {Q} _{mathbf {X} }={frac {1}{n}}mathbf {M} _{mathbf {X} }^{rm {T}}mathbf {M} _{mathbf {X} },qquad mathbf {Q} _{mathbf {XY} }={frac {1}{n}}mathbf {M} _{mathbf {X} }^{rm {T}}mathbf {M} _{mathbf {Y} }.}{displaystyle mathbf {Q} _{mathbf {X} }={frac {1}{n}}mathbf {M} _{mathbf {X} }^{rm {T}}mathbf {M} _{mathbf {X} },qquad mathbf {Q} _{mathbf {XY} }={frac {1}{n}}mathbf {M} _{mathbf {X} }^{rm {T}}mathbf {M} _{mathbf {Y} }.}

These empirical sample correlation matrices are the most straightforward and most often used estimators for the correlation matrices, but other estimators also exist, including regularised or shrinkage estimators, which may have better properties.



Applications


The covariance matrix is a useful tool in many different areas. From it a transformation matrix can be derived, called a whitening transformation, that allows one to completely decorrelate the data[citation needed] or, from a different point of view, to find an optimal basis for representing the data in a compact way[citation needed] (see Rayleigh quotient for a formal proof and additional properties of covariance matrices).
This is called principal component analysis (PCA) and the Karhunen-Loève transform (KL-transform).


The covariance matrix plays a key role in financial economics, especially in portfolio theory and its mutual fund separation theorem and in the capital asset pricing model. The matrix of covariances among various assets' returns is used to determine, under certain assumptions, the relative amounts of different assets that investors should (in a normative analysis) or are predicted to (in a positive analysis) choose to hold in a context of diversification.



See also



  • Multivariate statistics

  • Gramian matrix

  • Eigenvalue decomposition

  • Quadratic form (statistics)

  • Principal components



References





  1. ^ Wasserman, Larry (2004). All of Statistics: A Concise Course in Statistical Inference. ISBN 0-387-40272-1..mw-parser-output cite.citation{font-style:inherit}.mw-parser-output q{quotes:"""""""'""'"}.mw-parser-output code.cs1-code{color:inherit;background:inherit;border:inherit;padding:inherit}.mw-parser-output .cs1-lock-free a{background:url("//upload.wikimedia.org/wikipedia/commons/thumb/6/65/Lock-green.svg/9px-Lock-green.svg.png")no-repeat;background-position:right .1em center}.mw-parser-output .cs1-lock-limited a,.mw-parser-output .cs1-lock-registration a{background:url("//upload.wikimedia.org/wikipedia/commons/thumb/d/d6/Lock-gray-alt-2.svg/9px-Lock-gray-alt-2.svg.png")no-repeat;background-position:right .1em center}.mw-parser-output .cs1-lock-subscription a{background:url("//upload.wikimedia.org/wikipedia/commons/thumb/a/aa/Lock-red-alt-2.svg/9px-Lock-red-alt-2.svg.png")no-repeat;background-position:right .1em center}.mw-parser-output .cs1-subscription,.mw-parser-output .cs1-registration{color:#555}.mw-parser-output .cs1-subscription span,.mw-parser-output .cs1-registration span{border-bottom:1px dotted;cursor:help}.mw-parser-output .cs1-hidden-error{display:none;font-size:100%}.mw-parser-output .cs1-visible-error{font-size:100%}.mw-parser-output .cs1-subscription,.mw-parser-output .cs1-registration,.mw-parser-output .cs1-format{font-size:95%}.mw-parser-output .cs1-kern-left,.mw-parser-output .cs1-kern-wl-left{padding-left:0.2em}.mw-parser-output .cs1-kern-right,.mw-parser-output .cs1-kern-wl-right{padding-right:0.2em}


  2. ^ William Feller (1971). An introduction to probability theory and its applications. Wiley. ISBN 978-0-471-25709-7. Retrieved 10 August 2012.


  3. ^ Taboga, Marco (2010). "Lectures on probability theory and mathematical statistics".


  4. ^ Eaton, Morris L. (1983). Multivariate Statistics: a Vector Space Approach. John Wiley and Sons. pp. 116–117. ISBN 0-471-02776-6.


  5. ^ Frahm, G.; Junker, M.; Szimayer, A. (2003). "Elliptical copulas: Applicability and limitations". Statistics & Probability Letters. 63 (3): 275–286. doi:10.1016/S0167-7152(03)00092-0.


  6. ^ Brookes, Mike. "The Matrix Reference Manual".




Further reading




  • Hazewinkel, Michiel, ed. (2001) [1994], "Covariance matrix", Encyclopedia of Mathematics, Springer Science+Business Media B.V. / Kluwer Academic Publishers, ISBN 978-1-55608-010-4

  • Weisstein, Eric W. "Covariance Matrix". MathWorld.


  • van Kampen, N. G. (1981). Stochastic processes in physics and chemistry. New York: North-Holland. ISBN 0-444-86200-5.










Popular posts from this blog

Y

Mount Tamalpais

Indian Forest Service