Download as pdf or txt
Download as pdf or txt
You are on page 1of 19

ECON 225: Data and

Statistics for Economics


Lecture 10
Plan for today
• Mean and variance of a random variable
• Information about the midterm
• Questions from the practice midterm
Mean of a random variable
• The mean of a set of observations is their arithmetic average.
• The mean µ of a random variable 𝑋 is a weighted average of the
possible values of 𝑋, reflecting the fact that not all outcomes are
necessarily equally likely
• The mean of 𝑋 is also called the expected value of 𝑋
• For a discrete random variable:
Mean of a random variable: Example
• A basketball player shoots three free throws. The random
variable X is the number of baskets successfully made (H).

HMM HHM

MHM HMH Value of X 0 1 2 3


Probability 1/8 3/8 3/8 1/8
MMM MMH MHH HHH

The mean µ of X is
µX = (0*1/8) + (1*3/8) + (2*3/8) + (3*1/8)
= 12/8 = 3/2 = 1.5
Law of large numbers
• The distribution of a random variable
describes the variation in the
population. Each time we take a
sample, we are drawing from the
distribution of the random variable
• As we take more and more draws (and
the sample size increases), the mean of
the sample gets closer and closer to the
population mean µ.

This is the law of large numbers. It is valid no matter what the


probability distribution of the random variable looks like.
Rules for means
Rule 1: If X is a random variable and a and b are fixed numbers, then
µa+bX = a + bµX
Rule 2: If X and Y are random variables, then
µX+Y = µX + µY
Rule 3: If X and Y are random variables, then
µX−Y = µX − µY
Investment example
You invest 20% of your funds in Treasury bills and 80% in an “index
fund” that represents all U.S. common stocks. Your rate of return over
time is proportional to that of the T-bills (X) and of the index fund (Y)
such that R = 0.2X + 0.8Y.
Based on annual returns between 1950 and 2003:
• Annual return on T-bills µX = 5.0%
• Annual return on stocks µY = 13.2%
Investment example
You invest 20% of your funds in Treasury bills and 80% in an “index fund” that
represents all U.S. common stocks. Your rate of return over time is proportional to
that of the T-bills (X) and of the index fund (Y) such that R = 0.2X + 0.8Y.
Based on annual returns between 1950 and 2003:
• Annual return on T-bills µX = 5.0%
• Annual return on stocks µY = 13.2%

µR = 0.2µX + 0.8µY = (0.2*5) + (0.8*13.2) = 11.56%

This portfolio has a smaller mean return than an all-stock portfolio.


Variance of a random variable
• Recall: The variance and standard deviation are measures of
spread
• The variance σ2X of a random variable is a weighted average of
the squared deviations (X − µX)2 of the variable X from its mean
µX. Each outcome is weighted by its probability in order to take
into account outcomes that are not equally likely.
• The positive square root of the variance gives the standard
deviation σ of X.
• For a discrete random variable:
Variance of a random variable: Example
A basketball player shoots three free throws. The random variable X is the
number of baskets successfully made.
µX = 1.5.
Value of X 0 1 2 3
Probability 1/8 3/8 3/8 1/8

The variance σ2 of X is
σ2 = 1/8*(0 − 1.5)2 + 3/8*(1 − 1.5)2 + 3/8*(2 − 1.5)2 + 1/8*(3 − 1.5)2
= 2*(1/8*9/4) + 2*(3/8*1/4) = 24/32 = 3/4 = 0.75
The standard deviation is √0.75 = 0.866
Rules for variances
Rule 1: If X is a random variable and a and b are constants, then
σ2a+bX = b2σ2X

Rule 2: If X and Y are independent random variables, then


σ2X+Y = σ2X + σ2Y
σ2X−Y = σ2X + σ2Y

Rule 3: If X and Y are NOT independent and have correlation ρ, then


only this one
σ2 X+Y = σ2 X + σ2 Y+ 2ρσXσY is provided in
formula sheet
σ2X−Y = σ2X + σ2Y − 2ρσXσY
Investment example - continued
You invest 20% of your funds in Treasury bills and 80% in an “index fund” that represents all
U.S. common stocks. Your rate of return over time is proportional to that of the T-bills (X) and
of the index fund (Y) such that R = 0.2X + 0.8Y.

Based on annual returns between 1950 and 2003:


• Annual return on T-bills µX = 5.0% σX = 2.9%
• Annual return on stocks µY = 13.2% σY = 17.6%
• Correlation between X and Y ρ = −0.11
Investment example - continued
You invest 20% of your funds in Treasury bills and 80% in an “index fund” that represents all
U.S. common stocks. Your rate of return over time is proportional to that of the T-bills (X) and
of the index fund (Y) such that R = 0.2X + 0.8Y.

Based on annual returns between 1950 and 2003:


• Annual return on T-bills µX = 5.0% σX = 2.9%
• Annual return on stocks µY = 13.2% σY = 17.6%
• Correlation between X and Y ρ = −0.11

σ2R = σ20.2X + σ20.8Y + 2ρσ0.2Xσ0.8Y sigma (SD) = 1402

= (0.2)! σ2X + 0.8! σ2Y + 2ρ*0.2*σX*0.8*σY

= (0.2)! (2.9)! + (0.8)! (17.6)! + (2)(−0.11)(0.2*2.9)(0.8*17.6) = 196.786


Mean and variance for continuous random
variables
• For continuous random variables, the mean and variance can be
found by integrating over the probability distribution (the probability
density function)
• In this course, we will not be finding the mean and variance of
continuous random variables
Review question 1
A fair coin is flipped twice. Let X = number of heads. Which of the
following is a valid (not necessarily correct) probability distribution of
X?
outcomes: HH, TH, HT, TT

X = heads

X = 0: TT = 1/4 x
X = 1: HT, TH = 2/4
X = 2: HH = 1/4
x

Hint: Find the one that the total of Probability is 1


Review question 2
Suppose that a random variable X has mean 5 and variance 2. Another random
variable Y has mean 10 and variance 4. The two variables are independent. What is
the variance of the random variable Z = X − Y?

µ (x) = 5 Z = σ² (x-y) = σ² (x) + σ² (y)


σ² (x) = 2 =2+4
=6
µ (y) = 10
σ² (y) = 4
Structure of the midterm
• During class time next Tuesday
• 80 minutes
• Short answer questions
• 5 to 6 questions with multiple parts
• Coverage will be until random variables (list of topics is posted on
Canvas)
The midterm
• You will need a non-programmable calculator for the midterm. Please
ensure you bring your own calculator. There will be no extra
calculators available to borrow during the midterm.
For next week
• Midterm on Tuesday
• UBC librarian will give a presentation about Economics data sources
on Thursday

I’M TIREDDDDDDD !!!!!!!!!!!!!!

You might also like