# How to find the variance of $U= X-2Y+4Z$? & The Co-variance of $U=X-2Y+4Z$ and $V = 3X-Y-Z$

EDIT

If the random variables $X,Y, Z$ have the expected,

$$\text{ means: }\mu_{x}=2 \qquad \qquad \mu_{y}=-3 \qquad \qquad \mu_{z} = 4$$

$$\text{variances: }\sigma_{x}^{2}=3 \qquad \qquad \sigma_{y}^{2}=2 \qquad \qquad \sigma^{2}_{z}=8$$

$$\text{covariances: }\text{cov}(X,Y) =1 \quad \quad \text{cov}(X,Z) = -2 \quad \quad \text{Cov}(Y,Z) = 3$$

find the variance of $U = X-2Y+4Z$.

The co-variance of $U$ and $V = 3X-Y-Z$

One must use these formulas in order to solve this problem.

From what I have deduced from the formulas above in order to find the variance one must use this formula $v(U)= \text{var}(a_x+b_y+c_z) =a^2\cdot \text{var}(x) +b^2\cdot \text{var}(Y)+c^2 \cdot \text{var}(z) + 2ab \cdot cov(x,y) +2ac\cdot \text{cov}(x,z)+2abc \cdot \text{cov}(Y,Z)$

To find the co-variance one must use this formula

$\text{cov}(u,v) = \text{cov}(a_1+b_1+c_1,a_2+b_2+c_2)=(a_{1})(a_{2})\text{var}(x)+(b_{1})(b_{2})\text{var}(Y)+(c_{1})(c_{2})\text{var}(Z)+\left[ (a_{1})(b_{2})+(b_{1})(a_{2}) \right] \cdot \text{cov}(X,Y)+\left[ (a_{1})(c_{2})+(c_{1})(a_{2}) \right] \cdot \text{cov}(X,Z)+ \left[ (b_{1})(c_{2})+(c_{1})(b_{2}) \right] \cdot \text{cov}(Y,Z)$

Is the formula that I used above a correct interpretation of what is alluded by in the formulas above?

Lastly, I do not want to make duplicates so the questions I have asked above is different from what I asked before in the previous questions, mainly because am asking about the interpretations of the formulas...... not just the answer.I hope this is enough information so that this question can be its own independent entity.

• Generally, $\text{var}(cX) = c^2\text{var}(X)$. if X and Y are independent, $\text{var}(X + Y) = \text{var}(X) + \text{var}(Y)$ – nivekgnay Oct 18 '16 at 21:51
• – Michael Hoppe Oct 18 '16 at 21:54
• @MichaelHoppe How does one use the formula Var $\sum^{n}_{i=1}X_{i} = \sum^{n}_{i=1}\sum^{n}_{i=1}Cov(X_{i},X_{j})$ .I am not to sure how one applies the Sum of correlated variables. – Jon Oct 18 '16 at 22:01
• $\sigma^2_{aX+bY}=a^2\sigma^2_ X+b^2\sigma^2_Y+2ab\sigma_{XY}$ – Michael Hoppe Oct 18 '16 at 22:08
• In your case, for example $\sigma^2_{3X+5Z}=3^2\sigma^2_X+5^2\sigma^2_Z+2\cdot3\cdot5\cdot\sigma_{XY}=9\cdot3+25\cdot8+30\cdot (-2)$. – Michael Hoppe Oct 18 '16 at 22:22

Let

$$Y := c_1 X_1 + c_2 X_2 + c_3 X_3 = \mathrm c^\top \mathrm X$$

Hence,

$$\mathbb E (Y) = \mathrm c^\top \mathbb E (\mathrm X)$$

and

$$\mbox{Var} (Y) = \mathrm c^\top \left( \mathbb E (\mathrm X\mathrm X^\top) - \mathbb E (\mathrm X) \mathbb E (\mathrm X^\top) \right) \mathrm c = \mathrm c^\top \mbox{cov} (\mathrm X) \, \mathrm c$$

Using the data in the question,

$$\mbox{Var} (Y) = \begin{bmatrix} 1\\ -2\\ 4\end{bmatrix}^\top \begin{bmatrix} 3 & 1 & -2\\ 1 & 2 & 3\\ -2 & 3 & 8\end{bmatrix} \begin{bmatrix} 1\\ -2\\ 4\end{bmatrix} = \cdots = 71$$

• Is one suppose to multiply matrices in order to get 71. $$\mbox{Var} (Y) = \begin{bmatrix} 1\\ -2\\ 4\end{bmatrix}^\top\cdot \begin{bmatrix} 3 & 1 & -2\\ 1 & 2 & 3\\ -2 & 3 & 8\end{bmatrix} \cdot\begin{bmatrix} 1\\ -2\\ 4\end{bmatrix} = \cdots = 71$$ – Jon Oct 19 '16 at 0:25
• I just wish I could wish away these thoughts but, how does one get 71 I just do not see it? – Jon Oct 19 '16 at 3:21
• @LittleJon Using SymPy Live, M = Matrix([[3, 1, -2], [1, 2, 3], [-2, 3, 8]]); v = Matrix([1, -2, 4]); print v.T * M * v produces Matrix([[71]]). – Rodrigo de Azevedo Oct 19 '16 at 6:51
• Sometimes I wish I had bought Matlab. Gracias Rodrigo. – Jon Oct 19 '16 at 15:03
• @LittleJon Just use the definition of the covariance matrix. – Rodrigo de Azevedo Oct 19 '16 at 17:06

Let $X^{T}=(X_{1},X_{2},X_{3})$, $a^{T}=(a_{1},a_{2},a_{3})$, $b^{T}=(b_{1},b_{2},b_{3})$, $U=a^{T}X$ and $V=b^{T}X$.

Then, by definition, \begin{equation*} E(a^{T}X) = a^{T}E(X)=a^{T}\mu,\qquad Var(a^{T}X) = a^{T}Var(X)a = a^{T}\Sigma a \end{equation*} where $\mu$ and $\Sigma$ are mean vector and variance-covariance matrix of $X$. With reference to the current example, $\mu = (2\;\; -3\;\; 4)^{T}$ and \begin{equation*} \Sigma = \left( \begin{array}{ccc} 3&1&-2\\ 1&2&3\\ -2&3&8 \end{array} \right) \end{equation*} \begin{eqnarray*} Cov(U,V)&=&E\left((U-E(U))(V-E(V))\right)\\ &=&E\left[(a^{T}X-E(a^{T}X))(b^{T}X-E(b^{T}X))\right]\\ &=&E\left[(a^{T}X-(a^{T}\mu))(b^{T}X-(b^{T}\mu))\right]\\ &=&E\left[a^{T}(X-\mu)b^{T}(X-\mu) \right]\\ &=&E\left[a^{T}(X-\mu)(X-\mu)^{T}b \right]\\ &=&a^{T}E\left[(X-\mu)(X-\mu)^{T}\right]b\\ &=&a^{T}\Sigma b \end{eqnarray*} Plug-in the expressions to get the required covariance.