Covariance, Correlation & Variance of Sums

By the end you'll be able to compute Cov(X,Y) and ρ from Var(X+Y) (or vice versa), and explain why zero correlation doesn't prove independence.

Predict: if you drag ρ from 0.5 toward 1, does the point cloud get tighter or looser around its tilt line? Then drag the slider below to check.

Drag the correlation slider and watch the cloud of (X, Y) points tilt and tighten. The live ρ and Cov readout inside the plot (same accent color as the points) tracks the sample, not the formula — so you can see how a finite sample estimates the theoretical values below. Toggle "Y = X²" to see a case where uncorrelated doesn't mean independent: Cov(X,Y) ≈ 0 even though Y is completely determined by X.

0.50
Sample Cov(X,Y)
Sample ρ
Var(X+Y) (sample)
Var(X)+Var(Y)+2Cov
Sampled cloud — hover a point for its (X, Y) values

Covariance \(\text{Cov}(X,Y) = \) \(E[XY]\) \(-\) \(E[X]\) \(E[Y]\) measures linear co-movement, and correlation \(\rho = \text{Cov}(X,Y)/(\sigma_X\sigma_Y) \in [-1,1]\) standardizes it. Variance of a sum: \(\text{Var}(X+Y) = \) \(\text{Var}(X)\) \(+ \text{Var}(Y) + 2\,\text{Cov}(X,Y)\).

Intuitive

Ask yourself: covariance is just "when \(X\) sits above its own average, does \(Y\) usually sit above its average too?" Positive means yes, negative means the opposite, near zero means no linear pattern. Rescale that answer to live between \(-1\) and \(1\) — that's the correlation coefficient — so you can compare variables measured in wildly different units.

Formal

\(\text{Cov}(X,Y) = E[XY] - E[X]E[Y]\). \(\rho = \text{Cov}(X,Y) / (\sigma_X\cdot\sigma_Y)\), with \(-1 \le \rho \le 1\). For any \(X, Y\): \(\text{Var}(X+Y) = \text{Var}(X) + \text{Var}(Y) + 2\,\text{Cov}(X,Y)\) — that extra cross term vanishes exactly when \(X\) and \(Y\) are uncorrelated, in particular whenever they're independent (independence is the stronger condition — see the joint-distributions lesson).

Applied

Say you're a reinsurer holding two correlated lines of business \(X\) and \(Y\) (e.g. property and business-interruption losses from the same storms). Your diversification benefit shrinks as \(\text{Cov}(X,Y)\) rises — at \(\rho = 1\) you get no risk reduction at all from combining the lines, since \(\text{Var}(X+Y)\) grows as fast as it possibly can.

Worked example
\(\text{Var}(X)=4\), \(\text{Var}(Y)=9\), \(\text{Cov}(X,Y)=3\) \(\Rightarrow\) \(\text{Var}(X+Y) = 4+9+2(3) = \) 19; \(\rho = 3/(2\cdot 3) = \) 0.5.
Your turn

Now flip the sign: \(\text{Var}(X)=5\), \(\text{Var}(Y)=3\), \(\text{Cov}(X,Y)=-1\) (the two variables move slightly opposite each other). Find \(\text{Var}(X+Y)\):

\(\text{Var}(X+Y) = 5 + 3 + 2(-1) = \) ____

Reveal the answer

\(\text{Var}(X+Y) = 5 + 3 - 2 = \) 6 — smaller than \(\text{Var}(X)+\text{Var}(Y) = 8\) because the negative covariance partly cancels, the same diversification effect from the applied example above.

More info — covariance from the joint distribution

Cov(X,Y) isn't a separate rule to memorize — it's \(E[XY]-E[X]E[Y]\), and each of those expectations comes straight from the joint distribution \(f(x,y)\) you met in the joint-distributions lesson: \(E[XY] = \sum_{x,y} xy\, f(x,y)\) (or the double integral in the continuous case). If \(X\) and \(Y\) are independent, \(f(x,y)\) factors as \(f_X(x)f_Y(y)\), the double sum splits into \(E[X]\cdot E[Y]\), and \(\text{Cov}(X,Y)\) collapses to exactly 0 — which is why independence always implies uncorrelated, but (as the interactive's "Y = X²" toggle shows) not the other way around. The StatQuest link in Dive deeper below walks through the E[XY] computation slowly if you want another pass.

Check your understanding

Question 1 of 4

Var(X) = 4, Var(Y) = 9, Cov(X,Y) = 3. What are Var(X+Y) and the correlation ρ?

Question 2 of 4

If Cov(X,Y) = 0, which conclusion is justified?

Question 3 of 4

X and Y are independent, so their joint density factors as f(x,y) = f_X(x)f_Y(y). What does that tell you about Cov(X,Y) and Var(X+Y)?

Question 4 of 4

Var(X) = 2, Var(Y) = 5, Cov(X,Y) = −1. Find Var(2X − Y).

Recap

  • \(\text{Cov}(X,Y) = E[XY] - E[X]E[Y]\) measures linear co-movement.
  • \(\rho = \text{Cov}(X,Y)/(\sigma_X\sigma_Y)\) rescales covariance to \([-1,1]\) so it's comparable across units.
  • \(\text{Var}(X+Y) = \text{Var}(X) + \text{Var}(Y) + 2\,\text{Cov}(X,Y)\); the cross term vanishes when \(X, Y\) are uncorrelated.
  • Uncorrelated (\(\rho = 0\)) does not imply independent — it only rules out a linear relationship, as the "Y = X²" toggle above shows.

Dive deeper

Sources

  • Covariance, Correlation, and Variance of Sums