# Correlation between two linear combinations of random variables

Let $X_1, X_2, X_3, X_4$ be independent random variables with $\operatorname{var}(X_i)=1$, and

$$U = 2X_1+X_2+X_3$$ $$V = X_2+X_3 + 2X_4$$

Find $\operatorname{corr}(U, V)$

In general, how can I calculate the correlation between two linear combinations of independent $X_i$ such as $U$ and $V$ knowing only $\operatorname{var}(X_i)$?

Or what if they weren't independent, but I had their covariance or correlation matrix?

• You can just go to this question. The answer are great. Commented Jul 28, 2018 at 22:30
• This question has no answer unless you know how $X_i$'s depend on each other. Commented Jul 28, 2018 at 23:11
• @KaviRamaMurthy I'm sorry! I forgot to mention the X's are independent Commented Jul 28, 2018 at 23:14
• I think Henry's answer below is too complicated. See my answer. Commented Jul 30, 2018 at 1:35

Hints:

• You do not know the means of the $X_i$, but life would be simpler of you assumed they were $0$; if they are not, then consider $X_i-E[X_i]$ instead, with the same variances and covariances

• If the means are $0$ then $\operatorname{var}(A)= E[A^2]$ and $\operatorname{cov}[A,B]=E[AB]$ and $\operatorname{corr}(A,B) = \frac{\operatorname{cov}[A,B]}{\sqrt{\operatorname{var}(A)}\sqrt{\operatorname{var}(B)}}$

• If $A$ and $B$ are independent with positive finite variances then $\operatorname{cov}[A,B]=0$ and $\operatorname{corr}(A,B) = 0$

• $E[nC+mD]=nE[C]+mE[D]$

So finding $\operatorname{corr}(U,V)$ is just a matter of substitution, multiplying and tidying up

• I cleaned up your MathJax usage. See my edits for proper usage. Commented Jul 30, 2018 at 1:25
• Certainly someone doing problems like this should rely on the bilinearity of covariance. Commented Jul 30, 2018 at 1:34

\begin{align} & \operatorname{cov}(U,V) \\[10pt] = {} & \operatorname{cov}(2X_1+X_2+X_3,X_2+X_3 + 2X_4) \\[10pt] = {} & 2\operatorname{cov}(X_1,\, X_2+X_3 + 2X_4) + \operatorname{cov}(X_2,\,X_2+X_3 + 2X_4) + \operatorname{cov}(X_3,\,X_2+X_3+2X_4) \end{align} I.e. covariance is linear in the first argument. Then for something like $\operatorname{cov}(X_1,\,X_2+X_3+2X_4),$ write \begin{align} & \operatorname{cov}(X_1,\,X_2+X_3+2X_4) \\[10pt] = {} & \operatorname{cov}(X_1,\,X_2) + \operatorname{cov}(X_1,\,X_3) + 2\operatorname{cov}(X_1,\,X_4) \end{align} and so on.

For $\operatorname{var} (U),$ you have $$\operatorname{var}(2X_1+X_2+X_3) = 2^2\operatorname{var}(X_1) +\operatorname{var}(X_2) + \operatorname{var}(X_3).$$

When $A,B,C$ are pairwise independent, the bilinearity of covariance states:

$$\mathsf{Cov}(A+B,B+C)~{=\mathsf {Cov}(A,B)+\mathsf {Cov}(A,C)+\mathsf {Cov}(B,B)+\mathsf {Cov}(B,C)\\=0+0+\mathsf{Var}(B)+0}$$

Just apply this principle to to find the covariance for your $U,V$.

...and of course, as $\mathsf{Var}(A+B)=\mathsf {Cov}(A+B,A+B)$, then the variances of $U,V$ may be found in the same manner.

PS: Of course, if the $X_i$ variables are not uncorrelated, then those covariances will not be zero.   However, the bilinearity rule is still usable.