4.2.4 Expectation and Variance of a Weighted Sum

Let Z = X + Y so:

E [Z ] = μz

by definition, but it can broken into its components X and Y .

                    ∑                ∑           ∑
E [Z ] = E [X + Y] =     pi(xi + yi) =    pi(xi) +    pi(yi) = μx + μy


Recall:

(a + b)2 = a(a + b) + b(a + b) = a2 + 2ab + b2


We will need this to understand V ar(c1X + c2Y )
Again let Z = X + Y

V ar(Z) = E [(Z - μ )2] = σ2
                   z       z


but you may only be able to solve for Z from the X and Y .

                     2                            2
Var (Z) = E [(Z  - μz) ] = E[((X +  Y) - (μx + μy)) ] =

Think of (X + Y ) as a and (μx + μy) as b.

           2                                 2
E [(X + Y )  - 2(X +  Y)(μx + μy ) + (μx + μy) ] =

Again using (a + b)2 = a2 + 2ab + b2

E [X2 +  2XY  + Y 2 - 2X μx - 2X μy - 2Y μx - 2Y μy + μ2 + 2 μxμy + μ2] =
                                                        x            y

Yes, a big mess but the terms can be regrouped and come up with the following:

      [                                                                     ]
=   E  (X2 - 2X  μx + μ2x) + (Y2 - 2Y μy + μ2y) + 2(XY  -  X μy - Y μx + μxμy)
      [         2                2                         ]
=   E [(X -  μx)   +    (Y - μy )   +    2(X -  μx)(Y - μy)      ]
=   E  (X -  μx)2]  +    E[(Y - μy )2]   +   2E [(X -  μx)(Y - μy )

=   V ar(X ) + V ar(Y ) + 2Cov (X, Y) = V ar(Z )

From these concepts:

V ar(c1X +  c2Y )  =   Var (c1X ) + V ar(c2Y ) + 2Cov (c1X, c2Y )
                       2           2
                  =   c1Var (X ) + c2V ar(Y ) + 2c1c2Cov (X, Y )

If we added a constant, c3 this not change the variance, see next formula:

Var (c1X  + c2Y +  c3) =   V ar(c1X ) + V ar(c2Y ) + 2Cov (c1X,c2Y )
                      =   c2V ar(X ) + c2V ar(Y ) + 2c cCov (X, Y )
                           1           2             1 2

Note: Cov(X,X) = V ar(X) and correlation, ρ = Covσ(Xσ,Y)
   x y