Discrete Random Vector: Covariance and Correlation
Covariance of Discrete Random Vectors
Two economic outcomes can vary together: household spending on two goods, delays at two distribution centres, or demand for two services. For a discrete random vector (X,Y), each possible pair has a probability. You can use those probabilities to measure whether values above one component's mean tend to accompany values above or below the other component's mean.
Measuring joint deviations
The covariance of X and Y is the expected product of their deviations from their respective means. Write μX=E(X) and μY=E(Y), and assume E(X2) and E(Y2) are finite.
A pair contributes positively when both deviations have the same sign: both values are above their means, or both are below. It contributes negatively when the deviations have opposite signs. If either value equals its mean, that pair contributes zero.
If X is measured in hours and Y in dollars, covariance has units of hour-dollars. If both are measured in minutes, its units are min2. These are product units, not the units of either component alone.
Computing from discrete probabilities
Let pXY(x,y)=P(X=x,Y=y) denote the joint probability mass function. For a finite distribution, compute the means and then average the products of deviations:
The sums run over possible component values; impossible pairs have probability zero. Check that all probabilities are nonnegative and sum to one before calculating expectations.
The cross-moment E(XY) is the expected product of the two components. It provides an equivalent calculation:
Multiply the two values within each pair first, weight that product by the pair's probability, and add. Then subtract the product of the means. Use each pair's joint probability; separate marginal probabilities generally do not supply the correct weight for a pair.
Interpreting the result
The sign identifies the balance of the weighted deviation products.
Covariance | Interpretation | What it does not establish |
|---|---|---|
Positive | Same-sign deviations outweigh opposite-sign deviations. | Every possible pair moves in the same direction. |
Negative | Opposite-sign deviations outweigh same-sign deviations. | Every high value of one component accompanies a low value of the other. |
Zero | Positive and negative contributions balance, or all contributions are zero. | The components are independent. |
Example: Spending on two goods can have positive covariance when households with above-average spending on one also tend to spend above average on the other. This association does not establish that buying one good causes purchases of the other.
Independence implies E(XY)=E(X)E(Y) and therefore zero covariance under the stated moment assumptions. However, zero covariance does not imply independence. A dependent pattern can still produce cancelling signed products.
Covariance magnitude also depends on measurement units. A numerical value alone does not provide a unit-free assessment of association strength. Report its units and explain its sign in the setting of the problem.
What to remember
- Covariance averages products of deviations from two means.
- For discrete outcomes, weight every paired contribution by its joint probability.
- Calculate either the centred sum or E(XY)−E(X)E(Y).
- Interpret the sign, retain product units, and distinguish zero covariance from independence.
Example: Coffee and tea orders
Example: A kiosk uses the following simplified probability model for a randomly selected ten-minute interval. Let X count coffee orders and Y count tea orders. Their covariance is the probability-weighted average product of deviations from their respective means.
X (orders) | Y (orders) | Probability |
|---|---|---|
0 | 0 | 0.10 |
0 | 3 | 0.20 |
2 | 0 | 0.30 |
2 | 3 | 0.40 |
The four listed pairs are the only possible outcomes in this model.
Part a: Find the expected order counts
Calculate E(X) and E(Y) in orders.
First check the probability total: 0.10+0.20+0.30+0.40=1.00.
Coffee orders equal two in the last two outcomes, so P(X=2) is ________. Tea orders equal three in the second and fourth outcomes, so P(Y=3) is ________. The remaining marginal probabilities are P(X=0)=0.30 and P(Y=0)=0.40.
Use these marginal probabilities to compute the expectations:
The expected counts are 1.4 coffee orders and 1.8 tea orders per ten-minute interval. These averages need not be possible individual order counts.
Part b: Calculate the covariance
Find Cov(X,Y) in orders2 using the expected product.
Multiply the counts within each pair, then weight by that pair's probability. Only the outcome (2,3) has a nonzero product.
Thus the expected product is ________. The product of the two means is ________, since (1.4)(1.8)=2.52.
Subtract in the order specified by the covariance formula:
The covariance is −0.12 orders2. No additional division by four is required: the joint probabilities already weight the four outcomes.
Part c: Interpret and check the sign
Explain the negative sign using the weighted deviations from the means.
Compute the centred product for each pair and multiply by its probability. Every contribution has units of orders2:
The same-sign contributions total 0.540 orders2, while the opposite-sign contributions total −0.660 orders2. Their sum is again −0.120 orders2.
Therefore, opposite-sign deviations dominate after probability weighting. The result describes an average association; it does not mean that every interval with more coffee orders has fewer tea orders.
For a retailer's discrete daily order count X and daily revenue Y, assume both population variances are finite. Complete these statements using statistical terms.
The correlation between X and Y is their covariance divided by the product of their . If either variable takes the same value with probability one, their correlation is .
A model describes weekly hours spent on errands, X, and exercise, Y, for a randomly selected adult. The joint probabilities are shown below. Calculate Cov(X,Y) in h2, to two decimal places.
X (h) | Y (h) | Probability |
|---|---|---|
1 | 2 | 0.20 |
1 | 5 | 0.30 |
3 | 2 | 0.10 |
3 | 5 | 0.40 |