[Math] Determining variance of sum of both correlated and uncorrelated random variables

covarianceprobabilityprobability distributionsprobability theoryvariance

David Mitra had a great, simple answer to a similar question of how to determine the variance of the sum of two correlated random variables. What if, however, I have three normally distributed random variables, only two of which are correlated with one another – how do I find the variance? My thinking is that since

Var(A+B) = Var(A)+ Var(B)+ 2Cov(A,B)

works for two correlated variables, maybe you can just throw in a third, uncorrelated variable C getting:

Var(A+B+C) = Var(A) + Var(B) + Var(C) + 2Cov(A,B)

Also, what if I have more variables and more of those variables are correlated? Say I have variables A, B, C, D and E and A, B and C are all correlated to one another. Would this be a possible solution:

Var(A+B+C+D+E) = Var(A) + Var(B) + Var(C) + Var(D) + Var(E) + 2Cov(A,B) + 2Cov(A,C) + 2Cov(B,C)

Best Answer

Since $\mathsf {Var}(S)=\mathsf{Cov}(S,S)$ and $\mathsf{Cov}(S,T)=\mathsf{Cov}(T,S)$, and covariance is bilinear, we have that:$$\begin{align}\mathsf {Var}(A+B) & =\mathsf{Cov}(A+B,A+B)\\ &=\mathsf{Cov}(A,A)+\mathsf{Cov}(A,B)+\mathsf{Cov}(B,A)+\mathsf{Cov}(B,B) \\ &= \mathsf{Var}(A)+2\mathsf{Cov}(A,B)+\mathsf{Var}(B)\end{align}$$

Likewise, in general:

$$\begin{align}\mathsf{Var}(\sum_{i}A_i) &=\mathsf {Cov}(\sum_i A_i,\sum_j A_j)\\ &= \sum_i\sum_j\mathsf{Cov}(A_i,A_j)\\&=\sum_i\mathsf{Var}(A_i)+2\sum_{i<j}\mathsf{Cov}(A_i,A_j)\end{align}$$

And specifically:$$\begin{align}\mathsf{Var}(A+B+C) &=\mathsf {Cov}(A+B+C,A+B+C)\\&~~\vdots\\&=\mathsf{Var}(A)+\mathsf{Var}(B)+\mathsf{Var}(C)+2\mathsf{Cov}(A,B)+2\mathsf{Cov}(A,C)+2\mathsf{Cov}(B,C)\end{align}$$

And so on.   Of course, if any two variables are pairwise uncorrelated, their relevant covariance term will vanish.