Section 9 Covariance, Multinomial and MVN

Stat 110
Section 9 Covariance, Multinomial and MVN
TF: Mingshu Huang ([email protected])
Section Hour: Tue 3-4pm, SC-216
Office Hour: Wed 9-10pm, SC-300H
Topics:
• Jointly, Marginal, Conditional Distribution:
– Joint Distribution: fX,Y (x, y)
– Marginal Distribution: (continuous case) fX (x) =
– Conditional Distribution: fY |X (y|x) =
R∞
−∞ fX,Y (x, y)dy
fX|Y (x|y)fY (y)
fX,Y (x, y)
= R∞
fX (x)
−∞ fX,Y (x, y)dy
• Covariance: Cov(X, Y ) = E((X − EX)(Y − EY )) = E(XY ) − E(X)E(Y )
– Cov(X, X) = V ar(X)
– Cov(X + Y, Z + W ) = Cov(X, Z) + Cov(X, W ) + Cov(Y, Z) + Cov(Y, W )
– V ar(X + Y ) = V ar(X) + V ar(Y ) + 2Cov(X, Y )
Cov(X, Y )
• Correlation: Corr(X, Y ) = p
V ar(X)V ar(Y )
– If X and Y are independent, then Cov(X, Y ) = Corr(X, Y ) = 0.
– But if Cov(X, Y ) = Corr(X, Y ) = 0, X and Y are NOT necessarily independent. (They
are uncorrelated though.)
• Multinomial: X ∼ M ultik (n, p) where X = (X1 , ..., Xk ) and p = (p1 , ..., pk ).
n!
pn1 pn2 pnk
n1 !n2 !...nk ! 1 2 k
– Marginal: If X ∼ M ultik (n, p), then Xj ∼ Bin(n, pj ).
– Joint PMF: P (X1 = n1 , ..., Xk = nk ) =
– Lumping: If X ∼ M ultik (n, p), then Xi + Xj ∼ Bin(n, pi + pj ).
– Covariance: If X ∼ M ultik (n, p), then for i 6= j, Cov(Xi , Xj ) = −npi pj .
• Multivariate Normal (MVN):
– Definition: t1 X1 + ... + tk Xk normal for any choice of t1 , ..., tk , then X = (X1 , ..., Xk ) is
MVN.
– Special case: k = 2 the Bivariate Normal
– Joint MGFs: E(eW ) = eE(W )+V ar(W )/2
– Corr=0 means independence! (only holds for MVN!!)
1
• 1D Transformation: fY (y) = fX (x)|
dx
| where X is continuous R.V. and Y = g(X) is
dy
differentiable and one-to-one.
Problems:
1. (Two Dice) Two fair dice are rolled, with outcome X and Y respectively.
(a) Are X+Y and X-Y correlated?
Cov(X + Y, X − Y ) = Cov(X, X) + Cov(Y, X) − Cov(X, Y ) − Cov(Y, Y ) = V ar(X) −
V ar(Y ) = 0
So they are uncorrelated.
(b) Are they independent?
No. One example would be if X − Y = 0 then X + Y must be an even number.
(c) To generalize, if X and Y are two random variables with Var(X)=Var(Y), what can we
say about the correlation of X+Y and X-Y?
As shown in 1(a), the correlation of X+Y and X-Y would be 0 if they have the same
variance.
2. (Max and Min) Let X, Y be i.i.d. Expo(1).
(a) What is the correlation between the minimum L = min(X, Y ) and A = |Y − X|?
A can be think as A=max(X,Y)-min(X,Y)=M-L where M=max(X,Y). Recall that if
you think of X and Y as the arrival time of two buses, A can be thought as the time
between the arrival of the first and the second bus and L the wait time for the first bus.
By the memoryless property of Exponential, A and L are independent, thus Corr(L,
A)=0.
2
(b) Calculate the correlation between L = min(X, Y ) and the maximum M = max(X, Y ).
From 2(b) we know M=A+L, so
Cov(L, M ) = Cov(L, A + L) = Cov(L, A) + Cov(L, L) = V ar(L) = 14 (because L is
minimum of Exponential, by Poisson process L ∼ Expo(2))
We also know V ar(L) = 41 and V ar(M ) = V ar(A + L) = V ar(A) + V ar(L) = 45 since
A ∼ Expo(1).
So Corr(L, M ) = √ Cov(L,M )
= √15 .
V ar(L)V ar(M )
3. (Sour Patch Revisited) Suppose you draw n candies from an infinite pool ofPsour patches;
each color (red, green, blue, yellow) has pi probability of being drawn, and
pi = 1. Let
Xi , i = 1, . . . , 4 be the number of red, green, blue and yellow patches of the n patches respectively.
(a) What is the joint distribution of X1 , X2 , X3 , X4 ?
It’s a M ulti4 (n, p) where p = (p1 , p2 , p3 , p4 ).
(b) Are the Xi ’s independent?
No, they sum up to n so knowing 3 of them equals knowing all 4 of them.
(c) What is the distribution of X1 ? Write the marginal density function of X1 .
It’s a Bin(n, p1 ).
(d) What is the distribution of X1 + X2 ? Calculate E(X1 + X2 ).
It’s a Bin(n, p1 + p2 )
(e) What is the conditional distribution of X2 given X1 = x1 ?
It’s equivalent to re-parameterize X1 in n − x1 people, so
p1
X2 |X1 = x1 ∼ Bin(n − x1 , 1−p
)
1
3
4. (Bivariate Normal) Let (X, Y ) be Bivariate Normal, with X and Y marginally N (0, 1) and
with correlation ρ between X and Y .
(a) Show that (X + Y, X − Y ) is also Bivariate Normal.
Let T = t1 (X + Y ) + t2 (X − Y ) = (t1 + t2 )X + (t1 − t2 )Y
Since (X, Y ) is Bivariate Normal, (t1 + t2 )X + (t1 − t2 )Y is a Normal for any t1 + t2
and t1 − t2 , so T is Normal for any t1 and t2 , therefore (X + Y, X − Y ) is also Bivariate
Normal.
(b) Find the joint PDF of X + Y and X − Y without using calculus.
From problem 1 we know Cov(X + Y, X − Y ) = 0 since X and Y have the same variance. That means X+Y and X-Y are uncorrelated. In the case of Multivariate Normal,
uncorrelation leads to independence, thus X+Y and X-Y are independent.
5. (1D Transformation) Determine the PDF of Y in each of the following:
(a) Y = Z 2 where Z ∼ N (0, 1).
Since Y = Z 2 is not one-to-one, we need to split it into:
√
√
x = y when x > 0 and x = − y when x < 0
1
√
In both cases | dx
dy | = 2 y
By 1D transformation we have
dx
−y/2 y −1/2
√1
fY (y) = fX (x)| dx
dy |I(x > 0) + fX (x)| dy |I(x < 0) = 2φ e
(b) U ∼ Unif(0,1) and Y = U 1/α , where α > 0
Find U in terms of Y: u = y α
du
α−1 for y ∈ (0, 1).
dy = αy
α−1 . This is a Beta(α, 1) distribution.
So fY (y) = fU (u)| du
dy | = αy
4