Chapter 4
Chapter 4
0-0
A Pair of Random Variables
• An experiment produces both X and Y
• Joint range:
1
Joint Cumulative Distribution Function (CDF)
• The joint CDF of random variables X and Y is
FX,Y (x, y) = P [X ≤ x, Y ≤ y]
2
Joint CDF Area
Y
3
Joint CDF Properties
For any pair of random variable X and Y ,
• 0 ≤ FX,Y (x, y) ≤ 1
• FX,Y (∞, ∞) = 1
• If x ≤ x1 and y ≤ y1 , then
4
Proof Example
FX (x) = P [X ≤ x]
= P [X ≤ x, Y < ∞]
= lim FX,Y (x, y) = FX,Y (x, ∞)
y→∞
5
Joint Probability Mass Function (PMF)
• Definition 4.2: The joint probability mass function of X and Y is
PX,Y (x, y) = P [X = x, Y = y]
6
Example
• Flip a coin three times.
• X = no. of H
7
Probability of Event {(X, Y ) ∈ B}
• Theorem 4.2: For discrete random variables X and Y and any set B in
the X, Y plane, the probability of the event {(X, Y ) ∈ B} is
P [B] = PX,Y (x, y)
(x,y)∈B
8
Marginal PMF
• Theorem 4.3: For discrete random variables X and Y with joint PMF
PX,Y (x, y),
PX (x) = PX,Y (x, y) , PY (y) = PX,Y (x, y) .
y∈SY x∈SX
9
Joint Probability Density Function (PDF)
• Definition 4.3: The joint PDF of the continuous random variables X and
Y is a function fX,Y (x, y) satisfying
x y
FX,Y (x, y) = fX,Y (u, v) dv du
−∞ −∞
∂ 2 FX,Y (x,y)
• Theorem 4.4: fX,Y (x, y) = ∂x ∂y
10
Joint PDF Properties
• fX,Y (x, y) ≥ 0 for all (x, y)
∞ ∞
• −∞ −∞ fX,Y (x, y) dx dy = 1
11
Marginal PDF
• If X and Y are random variables with joint PDF fX,Y (x, y),
∞
fX (x) = fX,Y (x, y) dy
−∞
∞
fY (y) = fX,Y (x, y) dx
−∞
12
Functions of Two Random Variables
• Theorem 4.9: For discrete random variables X and Y , the derived
random variable W = g(X, Y ) has PMF
PW (w) = P [g(X, Y ) = w] = PX,Y (x, y)
(x,y):g(x,y)=w
13
W = g(X, Y ): Examples
• Examples:
W1 = X + Y
W2 = max(X, Y )
W3 = XY
W4 = X/Y
14
Expected Values
• Theorem 4.12: For random variables X and Y , the expected value of
W = g(X, Y ) is
– Discrete:
E[W ] = E[g(X, Y )] = g(x, y)PX,Y (x, y)
x∈SX y∈SY
– Continuous:
∞ ∞
E[W ] = E[g(X, Y )] = g(x, y)fX,Y (x, y) dx dy
−∞ −∞
15
Expectations of Functions
• Theorem 4.13:
16
Expectations of Sums
For any two random variables X and Y ,
• E[X + Y ] = E[X] + E[Y ]
17
Covariance
• Definition 4.4: The covariance of two random variables X and Y is
• Cov [X, Y ] > 0 says, X > E[X] implies Y > E[Y ] is likely (X goes
up, Y goes up)
18
Correlation
• Definition 4.5: The correlation of X and Y is rX,Y = E[XY ]
• Cov [X, Y ] = rX,Y − μX μY
19
Orthogonality and Uncorrelateness
• Definition 4.6: X and Y are orthogonal if E[XY ] = 0
• Definition 4.7: X and Y are uncorrelated if Cov [X, Y ] = 0
20
Correlation Coefficient
• Definition 4.8: The correlation coefficient of two random variables X
and Y is
Cov [X, Y ]
ρX,Y =
Var [X] Var [Y ]
• Theorem 4.17: −1 ≤ ρX,Y ≤ 1
• Theorem 4.18: If Y = aX + b, then
⎧
⎪
⎨ −1
⎪ a<0
ρX,Y = 0 a=0
⎪
⎪
⎩
1 a>0
21
Conditioning by an Event
• Definition 4.9: For discrete random variables X and Y and an event B
with P [B] > 0, the conditional joint PMF of X and Y given B is
1
PX,Y |B (x, y) = P [X = x, Y = y|B] = P [(X = x, Y = y) ∩ B]
P [B]
22
Conditional Joint PDF
• Definition 4.10: Given an event B with P [B] > 0, the conditional joint
PDF of X and Y is
⎧
⎨ fX,Y (x,y) (x, y) ∈ B
P [B]
fX,Y |B (x, y) =
⎩ 0 otherwise
23
Conditional Expected Value
• Theorem 4.20: For random variables X and Y and an event B with
P [B] > 0, the conditional expected value of W = g(X, Y ) given B is
– Discrete:
E[W |B] = E[g(X, Y )|B] = g(x, y)PX,Y |B (x, y)
x∈SX y∈SY
– Continuous:
∞ ∞
E[W |B] = E[g(X, Y )|B] = g(x, y)fX,Y |B (x, y) dx dy
−∞ −∞
24
Conditional Variance
• Definition 4.11: The conditional variance of the random variable
W = g(X, Y ) is
• Theorem 4.21: Var [W |B] = E W |B − (E[W |B])2
2
25
Conditioning by a Random Variable
• Definition 4.12: For any event Y = y such that PY (y) > 0, the
conditional PMF of X given Y = y is
P [X = x, Y = y]
PX|Y (x|y) = P [X = x|Y = y] =
P [Y = y]
26
Conditional Expected Value
• Theorem 4.23: X and Y are discrete random variables. For any y ∈ SY ,
the conditional expected value of g(X, Y ) given Y = y is
E[g(X, Y )|Y = y] = g(x, y)PX|Y (x|y)
x∈SX
• Special cases
– E[X|Y = y]
– Cond. Variance:
2
Var [X|Y = y] = E (X − E[X|Y = y]) |Y = y
27
Conditional PDF
• Definition 4.13: For y such that fY (y) > 0, the conditional PDF of X
given Y = y is
fX,Y (x, y)
fX|Y (x|y) = .
fY (y)
• fX|Y (x|y):
28
Conditional Expected Value
• Definition 4.14: For continuous random variables X and Y and any y
such that fY (y) > 0, the conditional expected value of g(X, Y ) given
Y = y is
∞
E[g(X, Y )|Y = y] = g(x, y)fX|Y (x|y) dx.
−∞
29
Conditional Expected Value
• Definition 4.15: The conditional expected value E[X|Y ] is a function of
random variable Y such that if Y = y then E[X|Y ] = E[X|Y = y].
• Theorem 4.26:
+∞
EY [EX|Y [g(X, Y )|Y ]] = EX|Y [g(X, Y )|Y = y]fY (y)dy
−∞
= EX,Y [g(X, Y )]
30
Independent Random Variables
• Definition 4.16: X and Y are independent if and only if for all values of
x and y
– Discrete: PX,Y (x, y) = PX (x) PY (y)
– Continuous: fX,Y (x, y) = fX (x) fY (y)
31
Independence: Example 4.23
• Are X and Y independent?
⎧
⎨ 4xy 0 ≤ x ≤ 1, 0 ≤ y ≤ 1
fX,Y (x, y) =
⎩ 0 otherwise
..................................................................
33
Example 4.24 (continued)
• Region of nonzero density is triangular and
⎧
⎨ 12u(1 − u)2 0≤u≤1
fU (u) =
⎩ 0 otherwise
⎧
⎨ 12v(1 − v)2 0≤v≤1
fV (v) =
⎩ 0 otherwise
34
Properties of Independent RVs
• Theorem 4.27: For independent random variables X and Y ,
1. E[g(X)h(Y )] = E[g(X)]E[h(Y )]
2. rX,Y = E[XY ] = E[X]E[Y ]
3. Cov [X, Y ] = 0, ρX,Y = 0
4. Var [X + Y ] = Var [X] + Var [Y ]
5. E[X|Y = y] = E[X] for all y ∈ SY
6. E[Y |X = x] = E[Y ] for all x ∈ SX
35
Bivariate Gaussian Random Variables
• Definition 4.17: X and Y have a bivariate Gaussian PDF with
parameters μ1 , σ1 , μ2 , σ2 , and ρ if
⎡ 2 2 ⎤
x−μ1 2ρ(x−μ1 )(y−μ2 ) y−μ2
⎢ σ1 − σ1 σ2 + σ2 ⎥
exp ⎣− ⎦
2(1 − ρ2 )
fX,Y (x, y) =
2πσ1 σ2 1 − ρ2
where μ1 and μ2 can be any real numbers, σ1 > 0, σ2 > 0, and
−1 ≤ ρ ≤ 1.
36
ρ=0
fX,Y (x, y)
0.35
0.3
0.25
0.2 -3
0.15 -2
0.1 -1
0.05
0
0
-3 1
y
-2
-1
0 2
1
2
x 33
37
ρ = 0.9
fX,Y (x, y)
0.35
0.3
0.25
0.2 -3
0.15 -2
0.1 -1
0.05
0
0 y
-3 1
-2
-1
0 2
x 1
2
33
38
ρ = −0.9
fX,Y (x, y)
0.35
0.3
0.25
0.2 -3
0.15 -2
0.1 -1
0.05
0
0 y
-3 1
-2
-1
0 2
x 1
2
33
39
Bivariate Gaussian PDF
• Theorem 4.28: If X and Y are the bivariate Gaussian random variables
in Definition 4.17, X is the Gaussian (μ1 , σ1 ) random variable and Y is
the Gaussian (μ2 , σ2 ) random variable:
1 2 2
fX (x) = 2
exp [−(x − μ 1 ) /2σ1 ]
2πσ1
and
1 2 2
fY (y) = 2
exp [−(y − μ 2 ) /2σ2 ].
2πσ2
40
Rewriting the Bivariate Gaussian PDF
Complete the square of the exponent to write
where
1 −(x−μ1 )2 /2σ12
fX (x) = √ e
σ1 2π
1 −(y−μ̃2 (x))2 /2σ̃22
fY |X (y|x) = √ e
σ̃2 2π
σ2
μ̃2 (x) = μ2 + ρ (x − μ1 ) = E[Y |X = x]
σ1
σ̃2 = σ2 1 − ρ = Var [Y |X = x]
2
41
Conditional PDF of the Bivariate Gaussian RV
• Theorem 4.29: If X and Y are the bivariate Gaussian random variables
in Definition 4.17, the conditional PDF of Y given X is
1 2 2
fY |X (y|x) = √ e−(y−μ̃2 (x)) /2σ̃2
σ̃2 2π
where
σ2
μ̃2 (x) = μ2 + ρ (x − μ1 ) = E[Y |X = x]
σ1
2
σ̃2 = σ2 1 − ρ = Var [Y |X = x]
42
Gaussian PDF
43
Bivariate Gaussian Properties
• E[X] = μ1 , Var [X] = σ12
• Given X = x, Y is Gaussian
44
Bivariate Gaussian Properties
• Theorem 4.31: Bivariate Gaussian random variables X and Y in
Definition 4.17 have correlation coefficient ρX,Y = ρ.
45
Virtual Laboratories
• Bivariate Normal Experiment
• Bivariate Uniform Experiment
46
Chapter Summary
• Joint CDF FX,Y (x, y), joint PMF PX,Y (x, y), and joint PDF
fX,Y (x, y)
• Marginal PMF and marginal PDF
47