Covariance

Covariance is a measure of the co-movement between two random variables. While variance measure how a random variable moves with itself, covariance measures how a random variable moves with another random variable.

covxy = {Σ[(X-E(X))(Y − E(Y))]} / (n − 1)

A negative covariance means that variables move in different directions. A positive covariance means they move in the same direction.

Covariance can range from negative infinity to positive infinity. To make the information easier to understand, covariance is sometimes divided by the product of the random variable's standard deviations. This results in the correlation coefficient.

The advantage of the correlation coefficient is that it the resulting values range from -1 to +1. 1.0 means a perfect correlation, -1 means a perfect negative correlation. A correlation of 0 means there is no linear relationship between the two variables.