Covariance is a statistical metric to investigate a relation between two-dimensional data . This metric is used for computing correlation coefficient explained in the next page.
The Covariance can be defined as follows:
Here, and are the average of the data sequences ( and ), respectively.
As you can see from this definition the corresponds to the variance V[X], with dataset .
If you have m-dimensional data , we can compute each pair of m variables, and calculate each covariance. As a result from all the computed covariances, we can construct a matrix, called Covariance Matrix.
The (p,q) element of the covariance matrix is given by the following expression :
Diagonal elements of the covariance matrix is equal to the variance of each variable .
In fact, the correlation coefficient explained in the next page is more frequently used than this covariance matrix.