AdvStats - W5 - Joint Probabilities
AdvStats - W5 - Joint Probabilities
Economics
University of Manchester
1
Joint Probability Distributions
2
Joint Probability Distributions
For two discrete random variables, X & Y, have
Pr(X = x ∩Y = y) = p(x, y)
and p ( x, y ) 1
x y
Note: the order of summation can be
switched
3
Example I
H and W: weekly incomes of husbands and wives
(£100s)
h
0 1 2
0 0.05 0.15 0.10
w 1 0.10 0.10 0.30
2 0.05 0.05 0.10
For example: Pr(H = 2, W = 1) = 0.30
The table entries are the joint probability
distribution 4
Marginal Probabilities
Marginal probability: probability of outcome for one
variable.
h
0 1 2 p(w)
0 0.05 0.15 0.10 0.30
w 1 0.10 0.10 0.30 0.5
2 0.05 0.05 0.10 0.2
p(h) 0.20 0.3 0.5 1.0
6
Functions of Two Variables
Total income of couple: T = H + W “household income”
h (value of t)
0 1 2
0 0.05 (0) 0.15 (1) 0.10 (2)
w 1 0.10 (1) 0.10 (2) 0.30 (3)
2 0.05 (2) 0.05 (3) 0.10 (4)
cov[X, Y] = 0
ρXY = 0
BUT:
ρXY = 0 does NOT imply independence
a nonlinear relationship may exist
11
Linear Combinations
Transformations)
12
Linear Transformations
Y = bX + c, constants b, c
Could be change of units
Eg, b ≈ 1.20, c = 0 to convert £ to €
Effects on mean and variance:
E[Y] = E[bX + c] = b E[X] + c
2
var[Y] = var[bX + c] = b var[X]
Effects on distribution
2 2 2
If X~N(µ,σ ) then Y~N(bµ+c,b σ )
13
Mean of Linear Combination
V = aX + bY + c, constants a, b, c
E[V]=E[aX+bY+c]
=a E[X]+b E[Y]+c
I.E.
μV = a.μX + b.μY + c
14
Mean: Generalisation
We have n random variables
Random variables X1, ..., Xn, constants c, a1, ..., an:
n
E c ai X i E[c a1 X 1 a2 X 2 ... an X n ]
i 1
apply E[.] to X1
c a1 E[ X 1 ]
E[ a2 X 2 ...an X n ]
apply E[.] to each random variable
c a1 E[ X 1 ]
Note that the E[.]
operation is taken a2 E[ X 2 ] ... an E[ X n ]
inside the n
Summation c ai E[ X i ]
i 1
15
Mean: Example
P = 2X1 + 5X2 – 3X3 + 4
E[X1] = 2, E[X2] = -1, E[X3] = 3
Mean of P:
E[ P] E[2 X 1 5 X 2 3 X 3 4]
E[.] operates 2 E[ X 1 ] 5E[ X 2 ] 3E[ X 3 ] 4
on each Xi
plug the
2 2 5 (1) (3) 3 4 numbers
6 in
16
Calculating Variances
Alternative formula to calculate variance:
var[X] = E[X 2] – {E[X ]}2 = E[X 2] – μ2
17
Calculating Covariances
Similarly for covariances:
cov[X, Y] = E[(X – μX)(Y – μY)]
= E[X Y] – μX μY
Proof:
expand the
cov[ X , Y ] E[( X X )(Y Y )] product
E[ XY X Y XY X Y ]
apply E[.] to
the random E[ XY ] X E[Y ] E[ X ]Y X Y
variables E[ XY ] 2 X Y X Y Simplify
formula
E[ XY ] X Y
18
The Implication of Zero Correlation
cov[X, Y] = E[(X – μX)(Y – μY)]
= E[X Y] – μX μY
Correlation: ρXY=cov[X,Y]/(σXσY)
For uncorrelated X & Y we have cov[X, Y] =0
This means E[X Y] – μX μY = 0
which E[X Y] = μX μY
the expected value of the product of uncorrelated random
variables is the product of their individual expected values
19
Variance of Linear Combination
Key result:
var[aX bY c ] a var[ X ] b var[Y ]
2 2
2ab cov[ X , Y ]
Combinations involving more than 1 random
variable require covariance terms
Notes provide proof; for V = aX + bY + c
2
use definition var[V] = E[(V – μ ) ]
V
& results for mean of linear combination
20
Variance: Example2 2Combination formula:
a H b W 2ab HW
2 2
2 1 ( 1) cov[ H , W ]
0.61 0.49 2 0.03 1.04 21
Variance: Uncorrelated Variables
For n uncorrelated random variables X1, X2, ..., Xn
Constants a1, a2, …, an
n n
var[ ai X i ] a var[ X i ]
2
i
i 1 i 1
If the random variables are
uncorrelated we can take
For uncorrelated X, Y var[.] inside the Summation
X Y X2 Y2
Hence for X ~ N ( X , ), Y ~ N ( Y , )
2 2
X Y
T aX + bY c ~ N ( T , )
2
T
T a x b y c mean formula
variance formula
23
Normal Variables: Example E.G. Wife &
Husband annual
earnings in
Suppose we have Independent thousands
W~ N(20, 5) and H~ N(30, 11)
Then if D = W – H, its mean and variance are
D can also be viewed as
D W H a “gender pay gap”
mean
=20 – 30 = -10
( 1) 2 W H
2
D
2
W
2 2
H
variance Independence implies zero
=5+11 –0 = 16
covariance
So D ~ N(-10, 16)
24
The Example continued
“The probability the Wife earns
To find Pr[D > 0]: more than the Husband”