Definition (Covariance)
Covariance is a measure of the joint variability of two random variables. It indicates the direction of the linear relationship between the variables.
If greater values of one variable mainly correspond with greater values of the other variable, the covariance is positive. If the opposite is true, the covariance is negative.
Formulas
Population Covariance
For two random variables and with means and :
An alternative computational formula is:
Sample Covariance
For a sample of size with sample means and :
Properties
Symmetry:
Self-Covariance (Variance):
Linearity:
Summation:
Independence: If and are independent, their covariance is zero. Note that the converse is not necessarily true (zero covariance does not imply independence, as the relationship could be non-linear).
Relation to Correlation
Covariance is scale-dependent, meaning its magnitude depends on the units of the variables. Correlation normalizes covariance to lie between -1 and 1.