Give the definition of covariance and say what quantity it captures.
The idea
Covariance measures how two random variables move together in a linear way. It is the probability-weighted average of the product of the two deviations from the means, which in symbols is: Covariance = E((X − E(X)) × (Y − E(Y))). In practice the same quantity is computed with a shortcut, the mean of the product minus the product of the means: Covariance = E(XY) − E(X) × E(Y). A positive value means the variables tend to be above or below their means together. A negative value means one tends to be high when the other is low. A value of zero means no linear co-movement. The covariance of X with itself equals Var(X). Covariance carries the units of X times the units of Y, so its size is hard to interpret on its own. For sample data, divide the sum of cross-products of deviations by n − 1. The typical error is forgetting to subtract E(X) × E(Y).
Formulas
Covariance shortcut
Cov(X, Y) = E[X × Y] − E[X] × E[Y]
- X, Y
- the two random variables
Gives the same value as the definition E[(X − E[X]) × (Y − E[Y])]. Forgetting to subtract the product of the means is the typical error.
A practice question
Which expression is the definition of the covariance of two random variables X and Y, and what does it capture?
- E[(X - E[X])(Y - E[Y])]: the average product of the deviations from the means, capturing how the two variables move together in a linear way. - correct
- E[(X - E[X])² (Y - E[Y])²]: the average product of squared deviations, capturing the joint dispersion of the two variables.Why not: Squares the deviations, which removes the sign; covariance keeps the sign to show whether the variables move in the same or opposite direction.
- E[X]E[Y]: the product of the means, capturing the typical size of the two variables.Why not: Uses the product of the means, which is what is subtracted from E[XY] and is not itself the covariance.
- E[(X - E[X])(Y - E[Y])] / (sigma_X sigma_Y): a unit-free measure of linear association bounded by -1 and +1.Why not: Describes the correlation coefficient, which is the covariance divided by the product of the standard deviations.
Cov(X, Y) = E[(X - E[X])(Y - E[Y])] = E[XY] - E[X]E[Y]. It is positive when the variables tend to be above or below their means together, negative when one tends to be above when the other is below.
A harder one
A risk analyst has four paired observations (X, Y): (2, 5), (4, 9), (6, 10) and (8, 16). What is the sample covariance, using the n - 1 divisor?
- 11.33 - correct
- 8.50Why not: Divides the sum of cross-deviations by n = 4 instead of n - 1 = 3.
- 34.00Why not: Reports the sum of the products of deviations without dividing by n - 1.
- 58.50Why not: Averages the raw products xy and never subtracts the sample means.
Means are 5 and 10. Products of deviations: (-3)(-5) + (-1)(-1) + (1)(0) + (3)(6) = 15 + 1 + 0 + 18 = 34. Divide by n - 1 = 3: 11.33.
The hardest tier
A reporting system gives the covariance between the monthly returns of two funds as 18, with both returns measured in percent (so the units are percent squared). A risk model expects the covariance of returns written as decimals, for example 0.05 for 5 percent. What value should be entered?
- 0.18Why not: Divides by 100 once, as if covariance were in the same units as the returns; it is a product of two return units and needs 100 x 100.
- 0.0424Why not: Takes the square root of 18 as if it were a variance converted to a standard deviation, then divides by 100.
- 180,000Why not: Multiplies by 10,000 instead of dividing; going from percent to decimals shrinks the numbers.
- 0.0018 - correct
Covariance has units of (X units) x (Y units). Converting both returns from percent to decimals divides each by 100, so the covariance is divided by 100 x 100 = 10,000: 18 / 10,000 = 0.0018.
In the app: 6 practice questions on this outcome, spaced review that brings it back before you forget it.
Start free →More in Multivariate Random Variables
- Express a probability mass function through a probability matrix and explain how this works.
- From a discrete bivariate random variable, obtain both its marginal and its conditional distributions.
- Describe the way an expected value of a function is obtained for a discrete bivariate random variable.
- Describe how covariance and correlation of two random variables relate to each other and to whether the variables are independent.
- Show, with examples, what happens to the covariance and correlation of two random variables when linear transformations are applied to them.
- Find the variance when two random variables are combined using weights.
- For a bivariate random variable, compute the expected value of one of its components given the other.
- Identify what makes a sequence of random variables independent and identically distributed (iid).
- Illustrate why, for iid random variables, the mean and variance of their sum are easier to calculate.