Skip to content

Files

Latest commit

Jan 30, 2019
51cf137 · Jan 30, 2019

History

History
180 lines (124 loc) · 5.81 KB

06_Jan_24.md

File metadata and controls

180 lines (124 loc) · 5.81 KB

Note 05 - Jan 24

3. Conditional distribution and conditional expectation

3.1 Conditional distribution

3.1.1 Discrete case

Definition Let X and Y be discrete r.v's. The conditional distribution of X given Y is given by:

P ( X = x | Y = y ) = ( P ( X = x , Y = u ) ) P ( Y = y )

P ( X = x | Y = y ) : f X | Y = y ( x ) , f X | Y ( x | y ) conditional probability mass function)

Conditional pmf is a legitimate pmf: given any y , f X | Y = y ( x ) 0 , x

x f X | Y = y ( x ) = 1

Note that given Y = y , as x changes, the value of the function f X | Y = y ( x ) is proportional to the joint probability.

f X | Y = y ( x ) P ( X = x , Y = y )

This is useful for solving problems where the denominator P ( Y = y ) is hard to find.

3.1.1.1 Example

X 1 P o i ( λ 1 ) , X 2 P o i ( λ 2 ) . X 1 ! ! ! X 2 , Y = X 1 + X 2

Q: P ( X 1 = k | Y = n ) ?

Note P ( X 1 = k | Y = u ) = f X 1 | Y = n ( k )

A: P ( X 1 = k | Y = n ) can only be non-zero for k = 0 , , n in this case,

$$ \begin{aligned} P(X_1=k|Y=n) &= \frac{P(X_1=k, Y=n)}{P(Y=n)} \ & \propto P(X_1=k, Y=n) \ & = P(X_1=k, X_2=n-k) \ & = e^{-\lambda_1}\frac{\lambda_1^k}{k!}\cdot e^{-\lambda_2}\frac{\lambda_2^{n-k}}{(n-k)!} \ & \propto (\frac{\lambda_1}{\lambda_2})^k / k!(n-k)!

\end{aligned} $$

we can get P ( X = k | Y = n ) by normalizing the above expression.

P ( X 1 = k , Y = n ) = ( λ 1 λ 2 ) k / k ! ( n k ) ! k = 0 n ( λ 1 λ 2 ) k / k ! ( n k ) !

but then we will need to fine k = 0 n ( λ 1 λ 2 ) k / k ! ( n k ) !

An easier way is to compare k = 0 n ( λ 1 λ 2 ) k / k ! ( n k ) ! with the known results for common distribution. In particular, if X B i n ( n , p )

P ( X = k ) = ( k n ) p k ( 1 p ) n k ( p 1 p ) k / k ! ( n k ) !

P ( X 1 = k | Y = n ) follows a binomial distributions with parameters n and p given by p 1 p = λ 1 λ 2 p = λ 1 λ 1 + λ 2

Thus, given Y = X 1 + X 2 = n , the conditional distribution of X 1 is binomial with parameter n and λ 1 λ 1 + λ 2

3.1.2 Continuous case

Definition: Let X and Y be continuous r.v's. The conditional distribution of X given Y is given by

f X | Y ( x | y ) = f X | Y = y ( x ) = f ( x , y ) f Y ( y )

A conditional pdf is a legitimate pdf $$ \begin{aligned} f_{X|Y}(x|y) \geq 0\quad \quad\quad& x,y\in \R\ \int_{-\infty}^\infty f_{X|Y}(x|y) dx = 1,\quad &y\in \R \end{aligned} $$

3.1.2.1 Example

Suppose X E x p ( λ ) , Y | X = x E x p ( x ) = f Y | X ( y | x ) = x e x y , y = e conditional distribution of Y given X = x

Q: Find the condition pdf f X | Y ( x | y )

A:

f X | Y ( x | y ) = f ( x , y ) f Y ( y ) f ( x , y ) = f Y | X ( y | x ) f X ( x ) = x e x y λ e λ x a x e x ( y + λ ) , x > 0 , y > 0

Normalization ( make the total probability 1)

f X | Y ( x | y ) = x e x ( y + λ ) 0 x e x ( y + λ ) d x 0 x e x ( y + λ ) d x = 1 λ + t 2 integration by parts

Thus, f X | Y ( x | y ) = ( λ + y ) 2 x e x ( y + λ ) , x > 0 .

This is a gamma distribution with parameters γ and λ + y

3.1.2.1. Example 2

Find the distribution of z = X Y .

Attention: the following method is wrong:

f Z ( z ) = 0 f Y | X ( z x | x ) f X ( x ) d x

If we want to directly work with pdf's, we will need to use the change of variable formula for multi-variables. The right formula have turns out to be

$$ \begin{aligned}

f_Z(z) & = \int_0^\infty f_{X,Z}(x,z)dx = \int_0^\infty f_{Z|X}(z|x) f_X(x)dx \\
    &= \int_0^{\infty} f(x, \frac{z}{x})\cdot \frac{1}{x}dx \\
    &= f_{Y|X}(\frac{z}{x}|x) f_X(x)\cdot\frac{1}{x}dx

\end{aligned} $$

As an easier way is to use cdf, which gives probability rather than density:

P ( Z = z ) = P ( X Y z ) = 0 P ( X Y z | X = x ) f X ( x ) d x ( law of total probability ) = 0 P ( Y z x | X = x ) f X ( x ) d x Y | X = x E x p ( x ) = 0 ( 1 e x z x ) λ e λ x d x = 1 e z 0 λ e λ x d x Z E x p ( 1 )

Notation X , Y | Z = k i i d means that given Z = k , X and Y are conditionally independent, and they follow certain distribution.

(the conditional joint cdf/pmf/pdf equals the predict of the conditional cdf's/pmf's/pdf's)

3.2 Conditional expectation

We have seen that conditional pmf/pdf are legitimate pmf/pdf. Correspondingly, a conditional distribution is nothing else but a probability distributions. It is simply a (potentially) different distribution, since it takes more information into consideration.

As a result, we can define everything which are previously defined for unconditional distributions also for conditional distributions.

In particular, it is natural to define the conditional expectation.

Definition. The conditional expectation of g ( X ) given Y = y is defined as

E ( g ( X ) | Y = y ) = { i 1 g ( x i ) P ( X = x u | Y = y )  if  X | Y = y  is discrete     g ( x ) f X | Y ( x | y ) d x  if  X | Y = y  is continuous

Fix y , the conditional expectation is nothing but the expectation taken under the conditional distribution.