Its components are the expected values of the random variables X1,…,Xn.
Remark. To compute μX it is enough to know the marginals pXi or fXi for i=1,…,n; it is not necessary to know the joint density of the random vector.
so the (i,j) entry is E(XiXj), with E(Xi2) on the diagonal.
Remark. To compute RX it is enough to know all the marginals for pairs of the random variables X1,…,Xn.
Properties.
RX=RXT (symmetric).
RX≥0 (in the sense of positive definite matrices; what is proved is aTRXa≥0 for all a, i.e. positive semidefinite).
Proof. 1 is trivial from the definition. For 2 one needs aTRXa≥0 for all a∈Rn:
aTRXa=aTE(XXT)a=E(aTXXTa).
Letting Z≜aTX=(a1,…,an)X1⋮Xn=∑i=1naiXi∈R (a scalar random variable), aTXXTa=Z2 and so aTRXa=E(Z2)≥0 since Z2≥0 always. □
Variance (covariance) matrix
Definition (variance matrix, or variance/covariance matrix).ΣX≜cov(X)≜E((X−μX)(X−μX)T)=E(X1−μ1)2⋮⋯(X1−μ1)(X2−μ2)⋯⋮(Xn−μn)2=var(X1)⋮cov(X1,Xn)cov(X1,X2)⋯⋯cov(X1,Xn)⋮var(Xn).
Remarks.
To compute ΣX it is enough to know fXiXj(xi,xj) for all i,j=1,…,n.
ΣX is symmetric (trivial).
For any a∈Rn: aTΣXa=aTE((X−μX)(X−μX)T)a=E(aT(X−μX)(X−μX)Ta)=E(Z2)≥0, where Z=aT(X−μX)∈R. The conclusion is that ΣX≥0 in the sense of positive definite matrices (positive semidefinite).
Proof of 5.ΣX=E(X−μX)(X−μX)T=E(XXT)−μXE(XT)−E(X)μXT+μXμXT=RX−μXμXT−μXμXT+μXμXT=RX−μXμXT.□
Cross-correlation matrix
Definition (cross-correlation matrix). Given two random vectors X∈Rn and Y∈Rm (warning: X∈Rn is an abuse of notation, because a random vector is not a vector of real numbers but a vector of functions; it is only used to point out the dimensionality), the cross-correlation matrix is
Proof.μY=E(AX+b)=AμX+b. For the covariance, the constant b cancels:
ΣY=E((Y−μY)(Y−μY)T)=E((AX+b−AμX−b)(…)T)=E(A(X−μX)(X−μX)TAT)=AΣXAT.
The last relation RY=ΣY+μYμYT was already proved (property 5). □
Singular covariance matrix
Lemma. Let V=(XY). If ΣV is singular, i.e. det(ΣV)=0, then there exists a vector (αβ)∈R2 such that (α,β)(XY)=αX+βY is a degenerate (constant) random variable.
Proof.ΣV singular ⇒ there exists a=(αβ)=(00) such that ΣVa=(00). Therefore
a nonnegative variable with zero mean, so α(X−μX)+β(Y−μY)=0, i.e.
αX+βY=αμX+βμY=c(constant, degenerate random variable).□
Corollary.V=(XY) cannot be absolutely continuous if detΣV=0. (Reason, combining the lemma with the remark that a curve has probability zero under a joint density: (X,Y) would lie on the line αx+βy=c, which has probability 1 and area 0.)
Versione ripasso
Column random vectors X=(X1,…,Xn)T.
Mean vector.μX=E(X)=(E(X1),…,E(Xn))T; only marginals needed.
Correlation matrix.RX=E(XXT), entries E(XiXj). Symmetric, positive semidefinite: aTRa=E(Z2)≥0 with Z=aTX. Needs only pairwise marginals.
Covariance matrix.ΣX=E((X−μX)(X−μX)T), entries cov(Xi,Xj), variances on the diagonal.
Singular Σ.detΣ(X,Y)=0⇒∃(α,β)=0 with αX+βY constant (from 0=aTΣa=E((α(X−μX)+β(Y−μY))2)); hence (X,Y) cannot be absolutely continuous.
Typical mistakes. Writing ΣY=AΣXA (the second factor is AT); adding b to the covariance; confusing R and Σ (they differ by μμT); dimension errors (AΣAT is m×m).