Working Systematically with Covariance and Correlation
Integrated problems often combine several tasks: extracting moments from a joint model, transforming one or both variables, checking an independence claim, and calculating the variance of a weighted sum. The reliable approach is to start with the joint distribution, calculate the moments needed for the question, and only then apply the appropriate formula. A correlation value by itself does not describe the full dependence structure, and zero covariance does not generally establish independence.
This tutorial is aligned with the SOA VEE Mathematical Statistics syllabus. The examples use discrete models so every probability and expectation can be checked directly. For a continuous joint density, the same definitions apply, with sums replaced by integrals.
For a discrete pair with joint probability mass function \(p(x,y)=P(X=x,Y=y)\), expectations are obtained by summing over all possible pairs:
In particular, calculate \(E[X]\), \(E[Y]\), \(E[XY]\), \(E[X^2]\), and \(E[Y^2]\) as needed. Then use \(\operatorname{Var}(X)=E[X^2]-(E[X])^2\), the analogous formula for \(Y\), and the covariance definition. A pair is independent exactly when its joint probabilities factor into the corresponding marginal probabilities for every pair of values. Independence implies zero covariance when the required moments exist, but the converse is not generally true.
A Useful Derivation: Covariance of Linear Combinations
When variables are added or rescaled, expanding the definition explains exactly where the covariance terms come from. For constants \(a,b,c,d\), write the centered versions of the two linear combinations:
Multiplying this expression by the corresponding centered expression for \(cX+dY\), then taking expectations, gives
Setting \(c=a\) and \(d=b\) yields the variance of a two-variable weighted sum:
The last term disappears only when the covariance is zero (including, but not limited to, the case of independence). This formula is not a license to assume independence; the model must justify that assumption if it is used.
Worked Example: Covariance, Correlation, and an Independence Claim
Let \(I\) and \(J\) be binary indicators with the following joint distribution. Define \(X=13I\) and \(Y=13J\). Determine the covariance and correlation of \(X\) and \(Y\), and assess the claim that they are independent.
| \(I\) | \(J\) | \(P(I,J)\) |
|---|---|---|
| 0 | 0 | 0.27 |
| 0 | 1 | 0.23 |
| 1 | 0 | 0.23 |
| 1 | 1 | 0.27 |
Method. First find the marginal probabilities and moments; then compute covariance from \(E[XY]-E[X]E[Y]\). The four probabilities are nonnegative and sum to \(0.27+0.23+0.23+0.27=1\), so this is a valid joint model.
Means. The probability that \(I=1\) is \(0.23+0.27=0.50\), and the probability that \(J=1\) is also \(0.50\). Therefore
Second moments and variances. Since \(I^2=I\) and \(J^2=J\), \(X^2=169I\) and \(Y^2=169J\). Thus \(E[X^2]=169(0.50)=84.5\), and
The same calculation gives \(\operatorname{Var}(Y)=42.25\).
Covariance and correlation. The product \(XY\) is 169 only when \(I=J=1\), which has probability 0.27; otherwise it is zero. Hence \(E[XY]=169(0.27)=45.63\), so
Both standard deviations are \(\sqrt{42.25}=6.5\), giving
Independence check. The marginal probabilities are \(P(I=1)=P(J=1)=0.50\). Independence would require \(P(I=1,J=1)=0.50(0.50)=0.25\), but the joint probability is 0.27. Thus \(I\) and \(J\), and consequently \(X\) and \(Y\), are not independent. The covariance is positive, consistent with the joint high outcome occurring more often than it would under independence.
Check. The correlation is positive and less than one, and the covariance is \(0.08(6.5)(6.5)=3.38\), agreeing with the direct calculation. A common mistake is to treat a small correlation as proof of independence; the joint-probability check shows that the claim is false.
Transformations Require the Transformed Moments
For transformed variables \(U=g(X)\) and \(V=h(Y)\), covariance is calculated from \(E[g(X)h(Y)]-E[g(X)]E[h(Y)]\). In general, one cannot obtain it by simply multiplying \(\operatorname{Cov}(X,Y)\) by a constant unless the transformations are linear. For example, \(X^2\) is a nonlinear transformation, so its covariance with \(Y\) requires moments involving \(X^2Y\) and \(X^2\).
Worked Example: Covariance After a Nonlinear Transformation
Suppose the pair \((X,Y)\) has the following joint distribution, with probability \(1/4\) at each listed point. Set \(U=X^2\) and \(V=Y\). Find \(\operatorname{Cov}(U,V)\), \(\operatorname{Corr}(U,V)\), and determine whether \(U\) and \(V\) are independent.
| \(X\) | \(Y\) | Probability |
|---|---|---|
| 0 | 0 | \(1/4\) |
| 1 | 1 | \(1/4\) |
| 2 | 0 | \(1/4\) |
| 3 | 2 | \(1/4\) |
Means needed for covariance. Averaging the four \(X\)-values gives \(E[X]=(0+1+2+3)/4=1.5\). Averaging \(Y\) gives \(E[Y]=(0+1+0+2)/4=0.75\). For the transformed variables,
The products \(UV=X^2Y\) at the four outcomes are \(0,1,0,18\). Therefore \(E[UV]=(0+1+0+18)/4=4.75\), and
Variances and correlation. The values of \(U\) are \(0,1,4,9\), so \(E[U^2]=E[X^4]=(0+1+16+81)/4=24.5\). Consequently, \(\operatorname{Var}(U)=24.5-(3.5)^2=12.25\). Also \(E[V^2]=E[Y^2]=(0+1+0+4)/4=1.25\), giving \(\operatorname{Var}(V)=1.25-(0.75)^2=0.6875\). Thus
The four \((U,V)\) pairs are \((0,0),(1,1),(4,0),(9,2)\), each with probability \(1/4\). In particular, \(P(U=0,V=0)=1/4\), while \(P(U=0)P(V=0)=(1/4)(1/2)=1/8\). The probabilities do not factor, so \(U\) and \(V\) are not independent. The positive correlation summarizes their linear association; it does not itself establish the form of their dependence.
Check. The covariance is positive, and both variances are positive, so the correlation is defined. The calculation uses transformed values throughout; substituting \(\operatorname{Cov}(X,Y)\) for \(\operatorname{Cov}(X^2,Y)\) would be incorrect.
Weighted Sums in a Hypothetical Loss Model
A weighted sum may represent a combined exposure, a portfolio total, or another linear aggregate. If \(W=aX+bY\), its mean is \(aE[X]+bE[Y]\), while its variance includes the cross-covariance term. The covariance may be positive, negative, or zero, so dependence can raise or lower the variance relative to a calculation that omits that term.
Worked Example: Variance of a Weighted Total
Consider a hypothetical two-coverage model, with amounts measured in thousands of dollars. Let \(I\) and \(J\) indicate whether each coverage produces a payment, and define \(X=8I\), \(Y=5J\). The joint probabilities are \(P(I=1,J=1)=0.30\), \(P(I=1,J=0)=0.20\), \(P(I=0,J=1)=0.10\), and \(P(I=0,J=0)=0.40\). A risk measure is \(W=2X+Y\). Find its mean and variance.
Marginal probabilities and moments. Here \(P(I=1)=0.30+0.20=0.50\), and \(P(J=1)=0.30+0.10=0.40\). Therefore \(E[X]=8(0.50)=4\) and \(E[Y]=5(0.40)=2\). Since the indicators are binary,
The indicator covariance is \(E[IJ]-E[I]E[J]=0.30-(0.50)(0.40)=0.10\). Scaling each indicator gives \(\operatorname{Cov}(X,Y)=(8)(5)(0.10)=4\).
Mean of the weighted total.
thousand dollars.
Variance of the weighted total. With weights \(a=2\) and \(b=1\),
The variance is \(86\) in squared thousands of dollars. As a check, under the stated joint model, \(W\) takes values 0, 16, 5, and 21 with probabilities 0.40, 0.20, 0.10, and 0.30, respectively. Its second moment is \(0.40(0^2)+0.20(16^2)+0.10(5^2)+0.30(21^2)=186\), and \(186-(10)^2=86\), matching the formula.
Common mistake. Omitting covariance gives \(4(16)+6=70\), which is wrong for this joint model. The omitted contribution is \(2(2)(1)(4)=16\), so the correct variance is \(70+16=86\). The shortcut without a covariance term applies only when the covariance is zero.
Common Exam Traps
- Using only marginal distributions. Marginal means and variances do not determine covariance; a joint probability or an equivalent dependence measure is needed.
- Confusing covariance with correlation. Covariance retains the variables’ units and changes under rescaling. Correlation standardizes covariance and is defined only when both variances are positive.
- Assuming zero covariance means independence. This implication is false in general. Check factorization of joint probabilities when independence is at issue.
- Dropping the cross term in a weighted variance. For \(aX+bY\), the term is \(2ab\operatorname{Cov}(X,Y)\), including its sign.
- Applying a linear transformation rule to a nonlinear function. For \(X^2\), \(|X|\), or another nonlinear transform, calculate the required transformed expectations directly from the joint model.
Check Your Understanding
For each problem, calculate from the stated model and retain the covariance term whenever it is needed.
- Let \(I,J\) be binary with probabilities \(P(1,1)=0.40\), \(P(1,0)=0.10\), \(P(0,1)=0.20\), and \(P(0,0)=0.30\). Set \(X=5I\), \(Y=4J\). Find covariance, correlation, and whether \(X,Y\) are independent. (Answer: \(\operatorname{Cov}(X,Y)=2\), \(\operatorname{Corr}(X,Y)=0.4082\), not independent.)
- A pair \((X,Y)\) takes the values \((0,0),(1,2),(2,1),(3,3)\), each with probability \(1/4\). Find \(\operatorname{Cov}(X,Y)\) and \(\operatorname{Corr}(X,Y)\). (Answer: \(\operatorname{Cov}(X,Y)=1\), \(\operatorname{Corr}(X,Y)=0.8000\).)
- Suppose \(\operatorname{Var}(X)=4\), \(\operatorname{Var}(Y)=9\), and \(\operatorname{Cov}(X,Y)=-2\). For \(A=2X-Y\) and \(B=X+3Y\), find \(\operatorname{Cov}(A,B)\) and \(\operatorname{Corr}(A,B)\). (Answer: \(\operatorname{Cov}(A,B)=-29\), \(\operatorname{Corr}(A,B)=-29/\sqrt{2409}\approx-0.5909\).)
- Let \(\operatorname{Var}(X)=2\), \(\operatorname{Var}(Y)=5\), \(\operatorname{Var}(Z)=1\), \(\operatorname{Cov}(X,Y)=0\), \(\operatorname{Cov}(X,Z)=0\), and \(\operatorname{Cov}(Y,Z)=0.5\). Find \(\operatorname{Var}(3X-2Y+Z)\). (Answer: \(37\).)
- Let \(X\) be equally likely to be \(-1,0,1\), and set \(Y=X^2\). Find \(\operatorname{Cov}(X,Y)\) and decide whether \(X,Y\) are independent. (Answer: \(\operatorname{Cov}(X,Y)=0\), but \(X,Y\) are not independent.)