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: 

LaTeX: Cov(X,Y) = E[(X - E(X))(Y - E(Y))]

and that the variance of a random variable is defined as: 

LaTeX: Var(X) = E[ (X - E(X))^2].

Further, the standard deviation is the square root of the variance: LaTeX: D(X) = \sqrt{Var(X)}

It follows immediately from the definitions that: 

LaTeX: Var(X) = Cov(X,X),

meaning that the variance of LaTeX: X is the covariance of LaTeX: X with itself. 


The correlation coefficient, LaTeX: \rho_{X,Y} , between two random variables, LaTeX: X and LaTeX: Y, is defined as: 

LaTeX: \rho_{X,Y} = \frac{Cov(X,Y)}{D(X)D(Y)}.

Obviously LaTeX: \rho_{X,Y} = \rho_{Y,X} , due to symmetry, and from the definitions above it also follows that: 

LaTeX: \rho_{X,X} = \frac{Cov(X,X)}{D(X)D(X)}  = \frac{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, LaTeX: X, Y and LaTeX: Z then the correlation coefficient matrix, denoted by LaTeX: Corr.matrix(X,Y,Z) is defined as: 

LaTeX: Corr.matrix(X,Y,Z) = 
LaTeX: \begin{bmatrix}
\rho_{X,X} & \color{blue} \rho_{X,Y} & \color{green} \rho_{X,Z}\\
 \color{blue}  \rho_{Y,X} & \rho_{Y,Y} & \color{red} \rho_{Y,Z} \\ 
\color{green} \rho_{Z,X} & \color{red} \rho_{Z,Y} & \ \rho_{Z,Z}
\end{bmatrix}
= 
\begin{bmatrix}
1 & \color{blue} \rho_{X,Y} & \color{green} \rho_{X,Z}\\
 \color{blue}  \rho_{Y,X} & 1& \color{red} \rho_{Y,Z} \\ 
\color{green} \rho_{Z,X} & \color{red} \rho_{Z,Y} & \ 1
\end{bmatrix}

Notice that the diagonal elements are all 1, and that the matrix is symmetric since the correlation coefficients are symmetric.