Home page for accesible maths 7 Linear transformations

Style control - access keys in brackets

Font (2 3) - + Letter spacing (4 5) - + Word spacing (6 7) - + Line spacing (8 9) - +

7.4 Variances of Linear Transformations

We are interested in 𝖵𝖺𝗋[𝒀] where 𝒀=A𝑿. First note that for any n-vector 𝒗,

𝒗𝒗=[v1v1v1v2v1vnv2v1v2v2v2vnvnv1vnv2vnvn,]

i.e. [𝒗𝒗]ij=vivj. Since 𝖢𝗈𝗏[Yi,Yj]=𝖤[YiYj]-𝖤[Yi]𝖤[Yj], we can, therefore, write

𝖵𝖺𝗋[𝒀]ij =𝖤[(𝒀𝒀)ij]-(𝖤[𝒀]𝖤[𝒀])ij
=𝖤[𝒀𝒀]ij-(𝖤[𝒀]𝖤[𝒀])ij

by the definition of matrix expectation. Hence

𝖵𝖺𝗋[𝒀]=𝖤[𝒀𝒀]-𝖤[𝒀]𝖤[𝒀],

and similarly 𝖵𝖺𝗋[𝑿]=𝖤[𝑿𝑿]-𝖤[𝑿]𝖤[𝑿].

With the ground work above we can now find the variance matrix for 𝒀=A𝑿.

Theorem 7.4.1.
𝖵𝖺𝗋[A𝑿]=A𝖵𝖺𝗋[𝑿]A.
Proof.
𝖵𝖺𝗋[𝒀] =𝖤[𝒀𝒀]-𝖤[𝒀]𝖤[𝒀]
=𝖤[A𝑿(A𝑿)]-𝖤[A𝑿]𝖤[A𝑿]
=A𝖤[𝑿𝑿]A-A𝖤[𝑿]𝖤[𝑿]A
=A𝖢𝗈𝗏[𝑿]A.

Setting A=𝒂 gives

𝖵𝖺𝗋[𝒂𝑿]=𝒂𝖵𝖺𝗋[X]𝒂=i=1nj=1nai𝖵𝖺𝗋[X]i,jaj=i=1nj=1nai𝖢𝗈𝗏[Xi,Xj]aj.

For n=1 we get back the familiar expression

𝖵𝖺𝗋[a1X1]=a12𝖵𝖺𝗋[X1].

For n=2 we get Equation (7.1), since, 𝖵𝖺𝗋[𝒂𝑿] is

𝖵𝖺𝗋[a1X1+a2X2] =(a1a2)(𝖵𝖺𝗋[X1]𝖢𝗈𝗏[X1,X2]𝖢𝗈𝗏[X2,X1]𝖵𝖺𝗋[X2])(a1a2)
=i=12j=12aiaj𝖢𝗈𝗏[Xi,Xj]
=a12𝖵𝖺𝗋[X1]+a22𝖵𝖺𝗋[X2]+2a1a2𝖢𝗈𝗏[X1,X2].

Finally, setting

A=[𝒂1𝒂2]

with 𝒀=A𝑿 gives

𝖵𝖺𝗋[𝒀]=[𝒂1𝒂2]𝖵𝖺𝗋[𝑿][𝒂1𝒂2]

So

𝖢𝗈𝗏[𝒂1𝑿,𝒂2𝑿]=𝖢𝗈𝗏[Y1,Y2]=𝖵𝖺𝗋[𝒀]1,2=𝒂1𝖵𝖺𝗋[𝑿]𝒂2.
Example 7.4.1.

A square d×d matrix M is positive semi-definite if for any d-vector 𝒂, 𝒂TM𝒂0. Why are all variance matrices positive semi-definite?

Solution.  Let M be a variance matrix for some random variable 𝑿. Then the variance of 𝒂T𝑿 is 𝒂TM𝒂; but variances cannot be negative.

Example 7.4.2.

Suppose the variance of X1 and X2 are both 1, and that their correlation is ρ.

  1. (a)

    Show that the variance of X1+X2 lies between 0 and 4.

  2. (b)

    What is the value of ρ and hence, what is the relationship between X1 and X2 when 𝖵𝖺𝗋[X1+X2]=2,4 and 0?

Solution. 

  1. (a)
    𝖵𝖺𝗋[X1+X2] =𝖵𝖺𝗋[X1]+𝖵𝖺𝗋[X2]+2𝖢𝗈𝗏[X1,X2]
    =1+1+2×1×1×ρ
    =2(1+ρ).

    The inequality follows as -1ρ1.

  2. (b)

    For 𝖵𝖺𝗋[X1+X2]=2, need ρ=0 (uncorrelated). For 𝖵𝖺𝗋[X1+X2]=4, need ρ=1, i.e. X2=X1+c; 𝖵𝖺𝗋[c+2X1]=4𝖵𝖺𝗋[X1]=4. For 𝖵𝖺𝗋[X1+X2]=0, need ρ=-1, i.e. X2=-X1+c; 𝖵𝖺𝗋[c]=0

Example 7.4.3.

Find 𝖢𝗈𝗏[X+Y,X-Y], when the variances are σX2 and σY2 and their correlation is ρ.

Solution. 

  1. (i)

    Matrix multiplication:

    𝖢𝗈𝗏[X+Y,X-Y] =[11][σX2ρσXσYρσXσYσY2][1-1]
    =σX2-σY2.
  2. (ii)

    Bilinearity:

    𝖢𝗈𝗏[X+Y,X-Y] =𝖢𝗈𝗏[X,X]+𝖢𝗈𝗏[Y,X]-𝖢𝗈𝗏[X,Y]-𝖢𝗈𝗏[Y,Y]
    =𝖵𝖺𝗋[X]-𝖵𝖺𝗋[Y]=σX2-σY2

    This uses 𝖢𝗈𝗏[X,Y]=𝖢𝗈𝗏[Y,X], 𝖵𝖺𝗋[X]=𝖢𝗈𝗏[X,X], and 𝖵𝖺𝗋[Y]=𝖢𝗈𝗏[Y,Y].

Independence

When X1,,Xn are independent and Y=𝒂𝑿, the variance formula simplifies to

𝖵𝖺𝗋[Y]=i=1nj=1naiaj𝖢𝗈𝗏[Xi,Xj]=i=1naiai𝖢𝗈𝗏[Xi,Xi]=i=1nai2𝖵𝖺𝗋[Xi],

because 𝖢𝗈𝗏[Xi,Xj]=0 for ij.

In particular, we get the following, which we will use repeatedly through the remainder of this module.

Corollary 7.4.2.

Let X1,,Xn be independent and define

  1. Sn=X1++Xn,

  2. X¯n=1nSn.

Then

  1. 𝖵𝖺𝗋[Sn]=𝖵𝖺𝗋[X1]++𝖵𝖺𝗋[Xn],

  2. 𝖵𝖺𝗋[X¯n]=1n2i=1n𝖵𝖺𝗋[Xi].

The variance of the sum is the sum of the variances, when X1,,Xn are independent.

Further, if X1,,Xn have the same variance, σ2, this simplifies to

  1. 𝖵𝖺𝗋[Sn]=nσ2,

  2. 𝖵𝖺𝗋[X¯n]=σ2n.

In particular, these formulae hold when X1,,Xn are i.i.d. (independent, identically distributed).

Example 7.4.4.

X1,,Xn are independent and for i=1,,n, XiN(1/i,1/i); what is 𝖵𝖺𝗋[i=1niXi]? Do the Xi need to be independent for this result to always hold?

Solution. 

𝖵𝖺𝗋[i=1niXi]=i=1ni2𝖵𝖺𝗋[Xi]=i=1ni2/i=n(n+1)/2.

Independence is required in general.

Example 7.4.5.

Two packs of batteries are for sale: pack A contains 4 batteries each exponentially distributed with expected lifetime 5 hours; pack B contains 2 batteries each exponentially distributed with expected lifetime 10 hours. The batteries in a pack are used consecutively. Show that the expected lifetimes for the packs are the same; which is the most reliable pack?

Solution.  For pack A the total lifetime TA=X1++X4 where Xi𝖤𝗑𝗉(1/5). So 𝖤[Xi]=5 and 𝖵𝖺𝗋[Xi]=52.

Hence 𝖤[TA]=4×5=20 hours, and 𝖵𝖺𝗋[TA]=4𝖵𝖺𝗋[X1]=4×52=100.

For pack B the total lifetime TB=Y1+Y2, where Yi𝖤𝗑𝗉(1/10). So 𝖤[Yi]=10 and 𝖵𝖺𝗋[Yi]=102. Hence 𝖤[TB]=2×10=20 hours, the same as A, and 𝖵𝖺𝗋[TB]=2𝖵𝖺𝗋[Y1]=2×102. If the expectations are the same, then reliable is equivalent to small variance. So choose pack A.

Example 7.4.6.

𝑿=(X1,X2,X3) has expectation vector and variance matrix given by

  1. 𝖤[𝑿]=(12-1),

  2. 𝖵𝖺𝗋[𝑿]=(101032125).

Find the expectations, variances and covariance of Y1=2X1+4X2 and Y2=X1-X2+X3.

Solution.  We have

(Y1Y2)=A(X1X2X3),

where

A=(2401-11).

Thus

𝖤[𝒀]=(𝖤[Y1]𝖤[Y2])=A𝖤[𝑿]=(2401-11)(𝖤[(X+Y)Z]-𝖤[X+Y]𝖤[Z]12-1)=(10-2),

and

𝖵𝖺𝗋[𝒀] =(𝖵𝖺𝗋[Y1]𝖢𝗈𝗏[Y1,Y2]𝖢𝗈𝗏[Y2,Y1]𝖵𝖺𝗋[Y2])=A𝖵𝖺𝗋[𝑿]A
=(2401-11)(101032125)(214-101)=(52007).

Note that Y1 and Y2 are uncorrelated even though the X’s are not.