6.6 Correlation Coefficient Matrix
In the video we will demonstrate the use of the correlation coefficient matrix and the concept of correlation coefficient. A brief overview of the theory is given below.
Recall that the covariance between two random variables is defined as:
Cov(X,Y)=E[(X−E(X))(Y−E(Y))]
and that the variance of a random variable is defined as:
Var(X)=E[(X−E(X))2].
Further, the standard deviation is the square root of the variance: D(X)=√Var(X).
It follows immediately from the definitions that:
Var(X)=Cov(X,X),
meaning that the variance of X is the covariance of
X with itself.
The correlation coefficient, ρX,Y , between two random variables,
X and
Y, is defined as:
ρX,Y=Cov(X,Y)D(X)D(Y).
Obviously ρX,Y=ρY,X , due to symmetry, and from the definitions above it also follows that:
ρX,X=Cov(X,X)D(X)D(X)=Var(X)Var(X)=1,
In other words, the correlation coefficient between a random variable with itself is 1.
In the video we also use the correlation coefficient matrix. For example, if we have three random variables, X,Yand
Z then the correlation coefficient matrix, denoted by
Corr.matrix(X,Y,Z)is defined as:
Corr.matrix(X,Y,Z)=
[ρX,XρX,YρX,ZρY,XρY,YρY,ZρZ,XρZ,Y ρZ,Z]=[1ρX,YρX,ZρY,X1ρY,ZρZ,XρZ,Y 1]
Notice that the diagonal elements are all 1, and that the matrix is symmetric since the correlation coefficients are symmetric.