# Variance of the sum of random variables

For a vector (X,Y,Z) with a multivariate normal distribution, $\mu$ and $\Sigma$ are given as the following:

$\mu = \begin{pmatrix} 76\\ 42\\ 22 \end{pmatrix}$ , and $\Sigma = \begin{pmatrix} 16 & 5 & -16 \\ 5 & 36 & 0 \\ -16 & 0 & 25 \\ \end{pmatrix}$

However, two new variables, A and B, have been defined:

$A=X-Z, \ \ B=X-Y$

If X, Y, and Z are independent and random, the mean and variance for the new variables can be found:

$E[A] = E[X-Z] = E[X] - E[Z] \\ Var(A) = Var(X-Z) = Var(X) - Var(Z)$

However, we cannot assume independence. How can you find the mean and variance of A and B?

• Why do you say X, Y and Z are independent? – LinAlg Oct 18 '16 at 18:51
• How did you get that formula for the variance, variance is always non negative. $\operatorname{var} (X-Z) = \operatorname{var} X + \operatorname{var} Z$ if $X,Z$ are independent. – copper.hat Oct 18 '16 at 18:51
• @LinAlg good question—I made that assumption mistakenly. I'm correcting the question now. – mattpolicastro Oct 18 '16 at 18:52
• Your title is inconsistent with the last statement. – copper.hat Oct 18 '16 at 18:55
• If they are independent, variances do not subtract. They add. – Paul Oct 18 '16 at 19:02

It all follows from linearity.

Let me use $W$ to represent the three dimensional rv. and $L$ is a linear map.

Then $E[LW] = L E[W] = L \mu$.

For variance: \begin{eqnarray} E[(LW -E[LW])((LW -E[LW])^T ] &=& E[(L(W-\mu))(L(W-\mu))^T ] \\ &=& L E[(W-\mu)(W-\mu)^T ] L^T \\ &=& L \Sigma L^T \end{eqnarray}

Then $A= L_1 W$, with $L_1 = \begin{bmatrix} 1 & 0 & -1\end{bmatrix}$ and $B = L_2 W$ with $L_2 = \begin{bmatrix} 1 & -1 & 0\end{bmatrix}$.

Grinding through the computations gives

Mean of $54$ and variance of $73$ for $A$, Mean of $34$ and variance of $42$ for $B$.

Means are linear, so $E[A]=E[X]-E[Z]$ whether or not they independent.

Variance is more complicated. Instead, you get $$Var(A)=Var(X)+Var(Z)-2Cov(X,Z)$$.

• So because A is defined as X-Z, we subtract twice the covariance rather than add? And the summation of each correlated variables' variance will always be positive? – mattpolicastro Oct 18 '16 at 19:12
• Correct on both counts. – Paul Oct 18 '16 at 19:13
• To make sure I'm understanding correctly in this case, would $Var(A) = 16 + 25 -2 (-16) = 73$ or $Var(A) = 16 + 25 + 2 (-16) = 9$? – mattpolicastro Oct 18 '16 at 19:36