How to compute correlation from variances
Company: Jefferies
Role: Data Scientist
Category: Statistics & Math
Difficulty: easy
Interview Round: Technical Screen
## 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:
1. Is this information sufficient to determine the correlation \(\rho_{X,Y}\)? If not, what additional quantity or quantities would you need?
2. 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)\).
3. 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?
### What a Strong Answer Covers
- States that \(\mathrm{Var}(X+Y)\) and \(\mathrm{Var}(X)\) alone are not enough.
- Explains that both \(\mathrm{Var}(Y)\) and \(\mathrm{Cov}(X,Y)\) are unknown in the sum-variance identity.
- Derives \(\mathrm{Cov}(X,Y)=\frac{\mathrm{Var}(X+Y)-\mathrm{Var}(X)-\mathrm{Var}(Y)}{2}\).
- Substitutes covariance into the correlation formula.
- Simplifies correctly when \(\mathrm{Var}(Y)=\mathrm{Var}(X)\).
- Mentions the final correlation must lie in \([-1,1]\).
### 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?
Quick Answer: 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.