How to compute correlation from variances
JefferiesData Scientist · Technical ScreenLast updated
Practice deriving correlation from variance identities for two random variables. The solution explains why Var(X+Y) and Var(X) alone are insufficient, derives covariance and correlation when Var(Y) is known, simplifies the equal-variance case, and checks edge cases where correlation is invalid or inconsistent.
Statistics Prompt: Compute Correlation from Variances
You have two random variables (X) and (Y). You are told:
- (\mathrm{Var}(X+Y))
- (\mathrm{Var}(X))
Answer the following:
- Is this information sufficient to determine the correlation (\rho_{X,Y})? If not, what additional quantity or quantities would you need?
- If you also know (\mathrm{Var}(Y)), derive (\rho_{X,Y}) in terms of (\mathrm{Var}(X+Y)), (\mathrm{Var}(X)), and (\mathrm{Var}(Y)).
- Special case: if you assume (\mathrm{Var}(Y)=\mathrm{Var}(X)), simplify the expression for (\rho_{X,Y}).
Constraints & Assumptions
- Assume (X) and (Y) have finite, positive variances unless you explicitly discuss a degenerate case.
- Use the variance identity for sums and the definition of correlation.
- Call out when a proposed set of variance values is internally inconsistent.
Clarifying Questions to Ask
- Are (\mathrm{Var}(X)) and (\mathrm{Var}(Y)) both positive?
- Are the given variances exact population values or sample estimates?
- Is the question asking for a symbolic derivation or a numeric example?
Follow-up questions
- What happens if \(\mathrm{Var}(X)=0\) or \(\mathrm{Var}(Y)=0\)?
- How would the formula change for \(\mathrm{Var}(X-Y)\)?
- Can you provide two examples with the same \(\mathrm{Var}(X+Y)\) and \(\mathrm{Var}(X)\) but different correlations?
- How would sample estimation error affect the computed correlation?
Solution walkthrough is for members
Get the full walkthrough with reference code and complexity analysis, plus Kitty Coach at 300 messages a day. Hints, the code runner and community answers stay free.