DOWNLOAD Mathematica Notebook EXPLORE THIS TOPIC IN the MathWorld Classroom

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


Wolfram Web Resources

Mathematica »

The #1 tool for creating Demonstrations and anything technical.

Wolfram|Alpha »

Explore anything with the first computational knowledge engine.

Wolfram Demonstrations Project »

Explore thousands of free applications across science, mathematics, engineering, technology, business, art, finance, social sciences, and more. »

Join the initiative for modernizing math education.

Online Integral Calculator »

Solve integrals with Wolfram|Alpha.

Step-by-step Solutions »

Walk through homework problems step-by-step from beginning to end. Hints help you try the next step on your own.

Wolfram Problem Generator »

Unlimited random practice problems and answers with built-in Step-by-step solutions. Practice online or make a printable study sheet.

Wolfram Education Portal »

Collection of teaching and learning tools built by Wolfram education experts: dynamic textbook, lesson plans, widgets, interactive Demonstrations, and more.

Wolfram Language »

Knowledge-based programming for everyone.