# Covariance of linear combinations of correlated random variables

I am trying to predict the covariance of two linear combinations of normal random variables: $\newcommand{\N}{\mathcal N}$ \begin{align} X &= w\N(u_1,\sigma^2_1)+(1-w)\N(u_2,\sigma^2_2) \\ Y &= w\N(u_1,\sigma^2_1)+(1-w)\N(u_3,\sigma^2_3) \end{align} where $w$ can range from $0$ to $1$.

I've tried solving for $\text{cov}(X,Y)$ using \begin{align} \text{cov}(X,Y) &= \text{E}(XY) - \text{E}(X)\text{E}(Y) \\ \text{cov}(X,Y) &= \text{corr}(X,Y)\sigma_X\sigma_Y \end{align}

but am not sure how to find $\text{E}(XY)$ in the first case and $\text{corr}(X,Y)$ in the second.

• Is this a question from a course or textbook? If so, please add the [self-study] tag & read its wiki. – gung Jan 8 '16 at 17:55
• Thanks for the information. No, this isn't for a course, I'm trying to apply this to a research study. – Matt P Jan 8 '16 at 17:59
• Is your model: $X = w A + (1-w) B$; $Y=w A + (1-w) C$, where A, B, and C are all uncorrelated? If so, $cov(X,Y) = w^2 \sigma^2_1$ . – Mark L. Stone Jan 8 '16 at 18:39
• @MarkL.Stone Could I also ask about the more complicated case, where A, B, and C are not all uncorrelated? E.g., the same overall model for X and Y, but where A = kB + (1-k)C? – Matt P Jan 8 '16 at 21:51
• @Matt P Expand out the covariance into a sum of terms, as per en.wikipedia.org/wiki/Covariance#Properties . Then simplify each term. In your original version, 3 out of 4 additive terms came out to zero. – Mark L. Stone Jan 8 '16 at 21:57

HINT:

\begin{align*} cov(aX+bY, cV + dW) &= E[acXV + adXW + bcYV + bd YW]\\ &-E[aX+bY]E[cV+dW]\\ &= acE[XV]+adE[XW]+ bcE[YV] + bdE[YW]\\ &- acE[X]E[V]-adE[X]E[W]-bcE[Y]E[V]-bdE[Y]E[W]\\ &= ac \times cov(X,V) + ad \times cov(X,W) + bc\times cov(Y,V) + bd \times cov(Y,W) \end{align*}

w is a constant ranging from 0 to 1.

Let P~ N(u1,σ21), Q ~ N(u2, σ22) and R~ N(u3, σ23)]

If variables P, Q, and R are independent, then

Cov (X, Y) = Cov [w*N(u1,σ21)+(1−w)N(u2, σ22), wN(u1,σ21)+(1−w)*N(u3, σ23)]

= Cov [wP + (1-w) Q, w*P + (1-w)*R]

= w2*Cov(P, P) + w*(1-w)Cov(P, R) + + w(1-w)*Cov(Q, P) + (1-w)2*Cov(Q, R)

= w2* σ21 [If variables P, Q, and R are pair-wise independent]

Alternately, by using Cov(X, Y) =E(XY)−E(X)E(Y)

Cov (X, Y) = Cov [wP + (1-w) Q, w*P + (1-w)*R]

= E[w2*P2 + w*(1-w)PR + + w(1-w)*QP + (1-w)2*QR] – E[wP + (1-w) Q]* E[w*P + (1-w)*R]

= w2*E(P2) + w*(1-w)E(PR) + + w(1-w)*E(QP) + (1-w)2*E(QR) -[w*u1 + (1-w)u2] [w*u1 + (1-w)*u3]

= w2*E(P2) - w2*u2

[If variables P, Q, and R are pair-wise independent, then E(XY) = E(X)*E(Y)]

= w2* σ21

Note: if the variables P, Q and R are not independent, then we would require more information regarding the co-variance/correlation between them.