You are on page 1of 36

SMU Classification: Restricted

SESSION 4*
EXPECTATION,
VARIANCE &
COVARIANCE
Chapter 5 of Notes

*Some slides from Prof Yang Zhenlin


SMU Classification: Restricted

Recap

2
SMU Classification: Restricted

Recap

3
SMU Classification: Restricted

Learning Objectives
 Expectation & Variance of a Discrete Random
Variable
 Expectation & Variance of a Continuous Random
Variable
 Covariance and Correlation Coefficient

4
SMU Classification: Restricted

Expectation of a Discrete R.V.


Expectation is an extremely important concept in summarizing
characteristics of distributions. It gives a measure of central
tendency.
Definition (Expectation of Discrete R.V.):
The expected value of a discrete r.v. X with pmf p(x) is
defined by
m = E(X) =  x p( x)  
all x
) + ) + … + ),

  ,…,
i.e., a weighted average of all possible values of X. It is also
called mean of the population represented by X.
Expected value of a discrete r.v. is just the weighted average
of the possible values of X, weighted by their chances to
occur. 5
SMU Classification: Restricted

Example 1
Suppose X is the number of heads in 2 tosses of a fair
coin. What is the expected number of heads?

Solution: Let X = # of heads


x P(x)
0 0.25
1 0.50
2 0.25
E(X) = (0 x 0.25) + (1 x 0.50) + (2 x 0.25)
= 1.0
Note: Expected value of X need not be an integer.

Should E(X) be population mean or sample mean?


SMU Classification: Restricted

Example 2
A firm believes it has a 50–50 chance of winning an $80,000
contract if it spends $5,000 on the proposal. If the firm spends
twice this amount on the proposal, it feels its chances of
winning the contract will improve to 60%. If the firm bases its
decision solely on expected value, how much should it spend
on the proposal?
Solution: Let X = Revenue at start of project

1st proposal: E(X)=.5(-5000)+.5(75000)=35,000

2nd proposal: E(Y)=.4(-10000)+.6(70000)=38,000

Since E(X)<E(Y), the company should spend $10,000 on


proposal. 7
SMU Classification: Restricted

Variance of a Discrete R.V.


Another important quantity of interest is the variance of a
r.v. X, denoted by Var(X), which is defined by
Var(X) = E[(X –)2], where  = E(X).

A related quantity is the standard deviation,


SD(X) =(X) = {Var(X)}1/2.
Variance and standard deviation (sd) measure how much
the values of X vary around its mean .
As (X –)2 is a function of X, i.e., u(X) = (X –)2, from the
results given in the last slide, we have
2
Var(X) = ∑ ( 𝑥− 𝜇 ) 𝑝 (𝑥) , if X is discrete with pmf p(x),
𝑎𝑙𝑙 𝑥 8
SMU Classification: Restricted

Variance of a Discrete R.V.


 As(X –)2 is a function of X, i.e., u(X) = (X –)2, from the
results given in the last slide, we have
Var(X) =    2
( x ) p ( x) , if X is discrete with pmf p(x),
all x

+  …

+  …

For random variable X with possible values ,…,


 
and expected value

9
SMU Classification: Restricted

Example 1 (continued)
Suppose X is the number of heads in 2 tosses of a fair
coin. What is the expected number of heads?
Solution: Let X = # of heads, recall E(X) = 1.0
x P(x)
0 0.25
1 0.50
2 0.25

σ  (0  1)2 (.25)  (1  1)2 (.50)  (2  1)2 (.25)  .50  .707

Possible number of
heads = 0, 1, or 2 10
SMU Classification: Restricted

Properties of Expectation & Variance


If X is a r.v. with mean , and c and d are arbitrary
constants, then
E(cX + d)
• E(cX + d) = cE(X) + b   ¿ ∑ ( 𝒄 𝒂𝒊 +𝒅 ) 𝑷(𝑿 =𝒂 𝒊)
• Var(X) = E(X2) – 2 𝒂𝒊

Var(X) = E[(X –)2]


 
¿𝒄 ∑ 𝒂𝒊 𝑷 ( 𝑿=𝒂𝒊 ) +𝒅 ∑ 𝑷(𝑿 =𝒂 𝒊)
𝒂𝒊 𝒂𝒊
= E(X2 –2X+ 2) ¿  𝒄𝑬 ( 𝑿 ) +𝒅 ×𝟏
= E(X2) –2 E(X)+ 2 ¿  𝒄𝑬 ( 𝑿 ) +𝒅
= E(X2) – 2
=   𝒂𝟐 𝑷 ( 𝑿 =𝒂 ) −2
∑ 𝒊 𝒊
𝒂𝒊

11
SMU Classification: Restricted

Properties of Expectation & Variance


If X is a r.v. with mean , and c and d are arbitrary
constants, then
• Var(cX + d) = c2Var(X) Var(cX + d)
= E[(cX + d – E[cX + d])2]
• (cX + d) = |c|(X).
= E[(cX + d – cE[X ] – d)2]
= E[(cX –cE[X ])2]
= E[c 2(X –E[X ])2]
= c 2E[ (X –E[X ])2]
= c2Var(X)

12
SMU Classification: Restricted

Properties of Expectation & Variance


For random variables X and Y, and if g is a function of X,
• E{cg(X) + d} = cE{g(X)} + d
• E(X + Y) = E(X) + E(Y)
• E(XY) = E(X)E(Y) only if X and Y are independent
• Var{g(X)} = E([g(X) – E{g(X}]2)
• Var{cg(X) + d} = c2 Var{g(X)}
• Var(X + Y) = Var(X) + Var(Y) only if X and Y are
independent

13
SMU Classification: Restricted

Example 3
The monthly sales at a computer store have a mean of $25,000
and a standard deviation of $4,000. Profits are 30% of the sales
less fixed costs of $6,000. Find the mean and standard
deviation of the monthly profit.
Solution: Let X = Sales. E(X) = 25,000, and Var(X) = 4,0002
Let Y = Profit. Then, Y = .30(X) – 6,000.
E(Profit) = E(Y)
= .30 E(X) – 6,000
= (.30)(25,000) – 6,000 = 1,500.
Var(Profit) = Var(Y)
= Var[(.30)(X) – 6,000]
= (.30)2Var(X) = 1,440,000
(Profit) = (Y) = 0.3(X) = 1,200. 14
SMU Classification: Restricted

Learning Objectives
 Expectation & Variance of a Discrete Random
Variable
 Expectation & Variance of a Continuous
Random Variable
 Covariance and Correlation Coefficient

15
SMU Classification: Restricted

Expectation & Variance of Continuous R.V.


Definition (Expectation of Continuous R.V.):
The expected value of a continuous r.v. with pdf f(x) is
defined by

 = E(X) = 
x f ( x)dx,
where the integration is taken over the range for which f is
defined.
If X is continuous with pdf f(x), the variance of X is given by:

  2
Var ( X )= ∫ ( 𝑥 − 𝜇 ) 𝑓 ( 𝑥 ) 𝑑𝑥
−∞
∞ ∞ 2
 
¿ ∫ 𝑥2 𝑓 ( 𝑥 ) 𝑑𝑥 −
−∞
{∫ −∞
𝑥𝑓 ( 𝑥 ) 𝑑𝑥
}
  𝐸 ( 𝑋 2 ) − 𝐸 ( 𝑋 )2
¿ 16
SMU Classification: Restricted

Example 4
2
𝑓 ( 𝑥 )= 3 𝑥 ,
   0< 𝑥 <1
Let X have density function {
0, otherwise
 

  1 1 4 1
3𝑥 3
0
2
E ( X ) =∫ 𝑥 ( 3 𝑥 ) 𝑑𝑥=∫ 3 𝑥 𝑑𝑥=
0 4
3
[ ] 0
=
4
  1 1 5 1
3𝑥 3
( 2
) 2
( 2
)
0
4
E X =∫ 𝑥 3 𝑥 𝑑𝑥=∫ 3 𝑥 𝑑𝑥=
0
[ ] 5 0
=
5
2
  4 3
2 2
Var ( X )= 𝐸 ( 𝑋 ) − 𝐸 ( 𝑋 ) = −
5 4
=0.2375 ()
17
SMU Classification: Restricted

Example 5
Example 6. The time elapsed, in minutes, between the
placement of an order of pizza and its delivery is a
random variable with pdf
  1
{
𝑓 ( 𝑥 )= 15 if
0
 25< 𝑥 <40

otherwise
 

(a) Determine the mean and standard deviation of the time


it takes for the pizza shop to deliver pizza.
(b) Suppose that it takes 12 minutes to bake pizza.
Determine the mean and standard deviation of the time
it takes for the delivery person to deliver pizza.

18
SMU Classification: Restricted

Example 5 (continued)
Solution: Let X be the time between order and delivery.
40
  1
(i) 𝐸 ( 𝑋 ) =∫ 𝑥
25
( )
15
𝑑𝑥=32.5
40
  1
𝜎 2 =Var ( X )=∫ ( 𝑥 − 32.5 )
25
2
( ) 15
𝑑𝑥=18.75
𝜎  =4.33
(ii) The time it takes for the delivery person to deliver
pizza is Y = X – 12. Therefore,
40
  1
𝐸 ( 𝑌 ) = 𝐸 ( 𝑋 − 12 )=∫ ( 𝑥 − 12 )
25 15
𝑑𝑥=32.5 −12=20.5 ( )
2
𝑉𝑎𝑟
  ( 𝑌 )= 𝐸 [ ( 𝑋 − 12− 20.5 ) ]
40
  1
¿∫ ( 𝑥 −12 − 20.5 )
25
2
( ) 15
𝑑𝑥 ¿  18.75
19
SMU Classification: Restricted

Learning Objectives

 Expectation & Variance of a Discrete Random


Variable
 Expectation & Variance of a Continuous Random
Variable
 Covariance and Correlation Coefficient

20
SMU Classification: Restricted

Covariance between R.V.s


Definition (Covariance between R.V.):
The covariance between any two jointly distributed r.v.s X
and Y, denoted by Cov(X, Y), is defined by
Cov(X, Y) = E[(X µX)(Y µY)] = E[XY]  µX µY
where µX = E[X] and µY = E[Y]
Properties of Covariance:
For any two r.v.s X and Y, and constants a, b, c and d,
• Cov(X, X) = Var(X)
• Cov(X, Y) = Cov(Y, X)
• Cov(aX+b, cY+d) = ac Cov(X, Y)
• If X and Y are independent then Cov(X, Y) = 0.
21
SMU Classification: Restricted

Covariance between Discrete R.V.s


 For a random variable X with mean µX and possible values a1,a2,
…,ak and a random variable Y with mean µY and possible values
b1,b2…bl ,
𝑪𝒐𝒗
  ( 𝑿 , 𝒀 ) =¿
  +
  +

( 𝑎 𝑘 − 𝜇 𝑋 ) ( 𝑏 1 − 𝜇𝑌 ) P ( X = 𝑎𝑘 , Y =𝑏1 ) +…+ ( 𝑎𝑘 − 𝜇 𝑋 ) ( 𝑏1 − 𝜇𝑌 ) P ( X =𝑎 𝑘 ,Y = 𝑏𝑙 )
  𝒌 𝒍
¿ ∑ ∑ (¿ ¿ 𝒂 𝒊 − 𝝁 𝑿 )¿ ¿¿  ¿𝑷(𝐗 =𝒂 𝒊 , 𝐘 =𝒃 𝒋)
𝒊=𝟏 𝒋=𝟏

22
SMU Classification: Restricted

Covariance between Continuous R.V.s


For two continuous random variables X and Y, with mean values
µX and µY respectively and joint probability density f(x,y),

∞ ∞
 
𝐶𝑜𝑣 ( 𝑋 , 𝑌 ) =∫ ∫ ( 𝑥 − 𝜇 𝑋 ) ( 𝑦 − 𝜇𝑌 ) 𝑓 ( 𝑥 , 𝑦 ) 𝑑𝑥𝑑𝑦
−∞ −∞

∞ ∞
 
¿∫ ∫ 𝑥𝑦𝑓 ( 𝑥 , 𝑦 ) 𝑑𝑥𝑑𝑦 − 𝜇 𝑋 𝜇 𝑌
−∞ −∞

23
SMU Classification: Restricted

Interpreting Covariance

Covariance between two random variables:

Cov(X,Y) > 0 X and Y tend to move in the same direction


Cov(X,Y) < 0 X and Y tend to move in opposite directions
Cov(X,Y) = 0 X and Y are independent

24
SMU Classification: Restricted

Example 6
An insurance agent offers two types of product: life insurance
and life annuity. Let X be the number of insurance policies sold
per month and Y be number of annuity policies sold per month.
Let the joint probability distribution between X and Y be:
X
Y 1 2 3 Total
1 0.1 0.2 0.3 0.6
2 0.1 0.1 0.2 0.4
Total 0.2 0.3 0.5 1

 𝑃 ( 𝑋= 1 )=0.2 , 𝑃 ( 𝑋= 2 )=0.3 , 𝑃 ( 𝑋 =3 )=0.5

 𝑃 ( 𝑌 =1 )=0.6 , 𝑃 ( 𝑌 =2 )= 0.4
 
25
SMU Classification: Restricted

Example 6 (continued)
 𝐄 ( 𝐗 ) =𝟏 ( . 𝟐 ) +𝟐 ( . 𝟑 )+ 𝟑 ( . 𝟓 ) =𝟐 .𝟑
  𝐚𝐫 ( 𝐗 ) =𝟏𝟐 × 𝑷 ( 𝑿 =𝟏 ) +𝟐𝟐 × 𝑷 ( 𝑿=𝟐 )+ 𝟑𝟐 × 𝑷 ( 𝑿=𝟑 ) − 𝑬 (𝑿 )𝟐
𝐕
𝟐 𝟐 𝟐 𝟐
  𝟏 ( . 𝟐 ) +𝟐 ( .𝟑 ) +𝟑 ( . 𝟓 ) − 𝟐 .𝟑 =. 𝟔𝟏
¿

 𝐄 ( 𝐘 ) =𝟏 ( . 𝟔 ) + 𝟐 ( . 𝟒 )=𝟏 . 𝟒
𝟐 𝟐 𝟐
𝐕
  𝐚𝐫 ( 𝐘 ) =𝟏 ( . 𝟔 ) +𝟐 ( . 𝟒 ) −𝟏 . 𝟒 =. 𝟐𝟒

𝑪𝒐𝒗
  ( 𝑿 , 𝒀 ) =( 𝟏− 𝟐 .𝟑 ) ( 𝟏 −𝟏 . 𝟒 ) 𝑷 ( 𝑿=𝟏 ,𝒀 =𝟏 ) + ( 𝟐 −𝟐 .𝟑 )( 𝟏 −𝟏 . 𝟒 ) 𝑷 ( 𝑿 =𝟐 ,𝒀 =𝟏 )+¿
( 𝟑 − 𝟐 .𝟑 )( 𝟏 − 𝟏 . 𝟒 ) 𝑷 ( 𝑿 =𝟑 ,𝒀 =𝟏 )+ ( 𝟏 −𝟐 . 𝟑 ) ( 𝟐− 𝟏. 𝟒 ) 𝑷 ( 𝑿=𝟏 , 𝒀 =𝟐 ) +¿
( 𝟐 −𝟐 .𝟑 ) ( 𝟐 −𝟏 . 𝟒 ) 𝑷 ( 𝑿 =𝟐 , 𝒀 = 𝟐 )+ (𝟑 − 𝟐. 𝟑 ) ( 𝟐 −𝟏 . 𝟒 ) 𝑷 ( 𝑿 =𝟑 ,𝒀 =𝟐 )
¿  ( 𝟏− 𝟐 .𝟑 ) ( 𝟏 −𝟏 . 𝟒 ) ( . 𝟏 )+ ( 𝟐− 𝟐. 𝟑 ) ( 𝟏− 𝟏 , 𝟒 ) ( . 𝟐 )+ ( 𝟑− 𝟐 .𝟑 ) ( 𝟏 −𝟏 . 𝟒 ) ( . 𝟑 )+ ¿
( 𝟏− 𝟐 .𝟑 ) ( 𝟐 − 𝟏 . 𝟒 ) ( . 𝟏 ) + ( 𝟐− 𝟐 .𝟑 ) ( 𝟐 − 𝟏 . 𝟒 ) ( . 𝟏 )+ ( 𝟑− 𝟐 .𝟑 ) ( 𝟐 − 𝟏 . 𝟒 ) ( .𝟐)

¿  −. 𝟎𝟐 26
SMU Classification: Restricted

Computing Mean for Investment Returns


Return per $1,000 for two types of investments

Investment
P(XiYi) Economic condition Passive Fund X Aggressive Fund Y
.2 Recession - $ 25 - $200
.5 Stable Economy + 50 + 60
.3 Expanding Economy + 100 + 350

E(X) = μX = (-25)(.2) +(50)(.5) + (100)(.3) = 50

E(Y) = μY = (-200)(.2) +(60)(.5) + (350)(.3) = 95


27
SMU Classification: Restricted

Computing Standard Deviation for


Investment Returns
Investment
P(XiYi) Economic condition Passive Fund X Aggressive Fund Y
.2 Recession - $ 25 - $200
.5 Stable Economy + 50 + 60
.3 Expanding Economy + 100 + 350

σ X  (-25  50)2 (.2)  (50  50)2 (.5)  (100  50)2 (.3)


 43.30

σ Y  (-200  95) 2 (.2)  (60  95) 2 (.5)  (350  95) 2 (.3)


 193.71
28
SMU Classification: Restricted

Computing Covariance for Investment


Returns
Investment
P(XiYi) Economic condition Passive Fund X Aggressive Fund Y
.2 Recession - $ 25 - $200
.5 Stable Economy + 50 + 60
.3 Expanding Economy + 100 + 350

σ X, Y  (-25  50)(- 200  95)(.2)  (50  50)(60  95)(.5)


 (100  50)(350  95)(.3)
 8250
29
SMU Classification: Restricted

Interpreting the Results for Investment


Returns
• The aggressive fund has a higher expected return, but
much more risk

μY = 95 > μX = 50

but

σY = 193.21 > σX = 43.30

• The Covariance of 8250 indicates that the two


investments are positively related and will vary in the
same direction

30
SMU Classification: Restricted

The Sum of Two Random Variables


• Expected Value of the sum of two random variables:

E(X  Y)  E( X)  E( Y )

• Variance of the sum of two random variables:

Var(X  Y)  σ 2
X Y  σ  σ  2σ XY
2
X
2
Y

• Standard deviation of the sum of two random variables:

σ X  Y  σ 2X  Y
31
SMU Classification: Restricted

Portfolio Expected Return &


Portfolio Risk
• Portfolio expected return (weighted average return):

E(P)  w E( X)  (1  w ) E( Y )
• Portfolio risk (weighted variability):

σ P  w 2σ 2X  (1  w )2 σ 2Y  2w(1 - w)σ XY
Where w = portion of portfolio value in asset X
(1 - w) = portion of portfolio value in asset Y

32
SMU Classification: Restricted

Portfolio Example
Investment X: μX = 50 σX = 43.30
Investment Y: μY = 95 σY = 193.21
σXY = 8250
Suppose 40% of the portfolio is in Investment X and
60% is in Investment Y:
E(P)  .4 (50)  (.6) (95)  77

σ P  (.4)2 (43.30)2  (.6) 2 (193.21)2  2(.4)(.6)(8250)


 133.04
The portfolio return and portfolio variability are between
the values for investments X and Y considered
individually
33
SMU Classification: Restricted

Correlation Coefficient
Definition. The correlation coefficient between any two
jointly distributed r.v.s X and Y, denoted by (X, Y), is
defined by Cov( X , Y )
 ( X ,Y ) 
Var( X ) Var( Y )

It measures the degree of association between X and Y,


and takes values in [1, 1].

Properties of Correlation Coefficient:


For any two r.v.s X and Y, and constants a, b, c and d,
(aX+b, cY+d) = (X, Y), if ac > 0,
=  (X, Y), if ac < 0.
34
SMU Classification: Restricted

Features of Correlation Coefficient


• Unit free
• Ranges between –1 and 1
• The closer to –1, the stronger the negative linear
relationship
• The closer to 1, the stronger the positive linear
relationship
• The closer to 0, the weaker any positive linear
relationship

35
SMU Classification: Restricted

Scatter Plots of Data with Various


Correlation Coefficients
Y Y Y

X X X
r = -1 r = -.6 r=0

Y Y

X X
r = +1 r = +.3
36

You might also like