Covariance provides a measure of the strength of the correlation between two or more sets of random variates. The covariance for two random variates X and Y, each with sample size N, is defined by the expectation value


where mu_x=<X> and mu_y=<Y> are the respective means, which can be written out explicitly as


For uncorrelated variates,


so the covariance is zero. However, if the variables are correlated in some way, then their covariance will be nonzero. In fact, if cov(X,Y)>0, then Y tends to increase as X increases, and if cov(X,Y)<0, then Y tends to decrease as X increases. Note that while statistically independent variables are always uncorrelated, the converse is not necessarily true.

In the special case of Y=X,


so the covariance reduces to the usual variance sigma_X^2=var(X). This motivates the use of the symbol sigma_(XY)=cov(X,Y), which then provides a consistent way of denoting the variance as sigma_(XX)=sigma_X^2, where sigma_X is the standard deviation.

The derived quantity


is called statistical correlation of X and Y.

The covariance is especially useful when looking at the variance of the sum of two random variates, since


The covariance is symmetric by definition since


Given n random variates denoted X_1, ..., X_n, the covariance sigma_(ij)=cov(X_i,X_j) of X_i and X_j is defined by


where mu_i=<X_i> and mu_j=<X_j> are the means of X_i and X_j, respectively. The matrix (V_(ij)) of the quantities V_(ij)=cov(X_i,X_j) is called the covariance matrix.

The covariance obeys the identities


By induction, it therefore follows that


See also

Bivariate Normal Distribution, Correlation Coefficient, Covariance Matrix, Statistical Correlation, Variance Explore this topic in the MathWorld classroom

Explore with Wolfram|Alpha


Snedecor, G. W. and Cochran, W. G. Statistical Methods, 7th ed. Ames, IA: Iowa State Press, p. 180, 1980.Spiegel, M. R. Theory and Problems of Probability and Statistics, 2nd ed. New York: McGraw-Hill, p. 298, 1992.

Referenced on Wolfram|Alpha


Cite this as:

Weisstein, Eric W. "Covariance." From MathWorld--A Wolfram Web Resource.

Subject classifications