Variances of linear combinations
Topic: Covariance and the multivariate normal · more questions on this topic
‹ Why a covariance is positive semi-definite Uncorrelated but dependent ›
Let \mathbf{X} have covariance matrix
\Sigma=\begin{pmatrix}4&2&1\\2&3&0.5\\1&0.5&2\end{pmatrix}.
Compute \operatorname{Var}(X_1-2X_2+X_3) and \operatorname{Cov}(X_1+X_2,\ X_2-X_3) using \operatorname{Var}(\mathbf{a}^\top\mathbf{X})=\mathbf{a}^\top\Sigma\mathbf{a} and \operatorname{Cov}(\mathbf{a}^\top\mathbf{X},\mathbf{b}^\top\mathbf{X})=\mathbf{a}^\top\Sigma\mathbf{b}.
Write the coefficients of each linear combination as a vector. The covariance matrix then handles both the diagonal variance terms and the cross terms. The cross terms are counted twice in a variance.
With \mathbf{a}=(1,-2,1)^\top,
\begin{aligned} \operatorname{Var}(\mathbf{a}^\top\mathbf{X}) &=\sum_{j,k}a_j a_k\sigma_{jk}\\ &=1\cdot 4+4\cdot 3+1\cdot 2+2\bigl[(1)(-2)(2)+(1)(1)(1)+(-2)(1)(0.5)\bigr]\\ &=18+2(-4+1-1)=10. \end{aligned}
With \mathbf{a}=(1,1,0)^\top and \mathbf{b}=(0,1,-1)^\top, \operatorname{Cov}(\mathbf{a}^\top\mathbf{X},\mathbf{b}^\top\mathbf{X})=\mathbf{a}^\top\Sigma\mathbf{b}. First
\Sigma\mathbf{b}=(2-1,\ 3-0.5,\ 0.5-2)^\top=(1,\ 2.5,\ -1.5)^\top,
so the covariance is 1+2.5=3.5.