Professional Documents
Culture Documents
Example. For the previous example , calculate the conditional variance Var(X|X ≥ 1)
Solution.
Definition of conditional density. Assume and arbitrary random variable X with density
We already calculated E(X 2 | X ≥ 1). We only need to calculate E(X | X ≥ 1).
fX . Take an event A with P (A) > 0. Then the conditional density fX|A is defined as follows: ( )
∫ ∫ ∫
1 256 4 1 3
f (x) E(X | X ≥ 1) = x f (x) dx = x x dx
P (A) x∈A P (X ≥ 1) {x≥1} 255 1 64
fX|A (x) =
0 x∈ ∫ ( ) ( )( )[
/A 256 4 1 4 256 1 1 5 ]x=4 4096
= x dx = x =
Note that the support of fX|A is supported only in A. 255 1 64 255 64 5 x=1 1275
Finally: ( )
8192 4096 2 630784
Var(X|X ≥ 1) = E(X 2 |X ≥ 1) − E(X|X ≥ 1)2 = − =
765 1275 1625625
Definition of conditional expectation conditioned on an event.
∫ ∫
1
E(h(X)|A) = h(x) fX|A (x) dx = h(x) fX (x) dx Definition of conditional expectation conditioned on a random variable. Suppose two
A P (A) A
random variables X and Y . To define E(X|Y ) we need the conditional density function. For
Example. For the random variable X with density function this , let fX,Y (x, y) be the joint density of the pair {X, Y }. Thsn the conditional density fX|Y
1 x3 0<x<4 is defined
64
f (x) =
0
fX,Y (x,y)
fY (y) > 0
otherwise
fY (y)
fX|Y (x|y) =
calculate E(X 2 | X ≥ 1).
0 fY (y) = 0
∫∞
Solution. Then E(h(X) | Y ) is defined to be the random variable that assigns the value −∞ h(x) fX|Y (x|y) dx
∑
Step 1. to y in the continuous case, and assigns the value h(x) fX|Y (x|y) in the discrete case.
∫ 4
1 3 1 [ 1 4 ]x=4 255 x
P (X ≥ 1) = x dx = x =
1 64 256 4 x=1 256
Example. Take the following joint density:
Step 2. ( )
∫ ∫ 4
1 256 1 3
E(X 2 | X ≥ 1) = x2 f (x) dx = x2 x dx
P (X ≥ 1) {x≥1} 255 1 64
X=1 X=2 X=3 fY (y)
∫ 4( ) ( )( )[
1 6 ]x=4 8192
Y =1 0.07 0.1 0.23 0.4
256 1 5 256 1
= x dx = x =
255 1 64 255 64 6 x=1 765 Y =2 0.25 0.08 0.07 0.4
Y =3 0.05 0.04 0.11 0.2
Definition of conditional variance conditioned on an event. fX (x) 0.37 0.22 0.41 1
Var(X|A) = E(X 2 |A) − E(X|A)2 Describe the random variable E(Y 2 |X)
1 2
∑ ∑
Solution. E(Y 2 |X = 1) = y 2 fY |X (y|1) = y 2 f (X=1 , Y =y)
fX (1)
BX taking E of both sides we get:
y y
Law of Total Expectation. Note: Using similar arguments , one can prove the following:
E(X) = E(E[X|Y ])
Example (from the Dean’s note): Two urns contain a large number of balls with each ball
Law of Total Variance. marked with one number from the set {0, 2, 4}. The proportion of each type of ball in each urn
An urn is randomly selected and then a ball is drawn at random from the urn. The number on
the ball is represented by the random variable X.
3 4
(c) Calculate the process variances (or conditional variances)
(e) Calculate the total variance (or unconditional variance) Var[X] and show that it equals
the sum of the quantities calculated in (b) and (d) .
Part (b)
1 1
E[X] = E[E[X|θ]] = ( )(1.0) + ( )(3.0) = 2.0
2 2
1 1
Var[E[X|θ]] = ( )(1.0 − 2.0) + ( )(3.0 − 2.0)2 = 1.0
2
2 2
Part (c)
Part (d)
1 1
E[Var[X|θ]] = ( )(1.8) + ( )(1.8) = 1.8
2 2
Part (e)
[ ]
Var[X] = 1
2 (0.6)(0 − 2.0)2 + (0.3)(2 − 2.0)2 + (0.1)(4 − 2.0)2
[ ]
2 (0.1)(0 − 2.0) + (0.3)(2 − 2.0) + (0.6)(4 − 2.0)
1 2 2 2
+
= 2.8