0% found this document useful (0 votes)
27 views11 pages

234-Lectures 7 8

The document discusses the transformation method for random variables. It provides two theorems for transforming random variables: one for discrete random variables and one for continuous random variables. The theorems give the formulas for finding the probability density function (pdf) of the transformed random variable(s). Several examples are then worked through to demonstrate applying the transformation method and finding the pdfs of transformed random variables.

Uploaded by

yazan a
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views11 pages

234-Lectures 7 8

The document discusses the transformation method for random variables. It provides two theorems for transforming random variables: one for discrete random variables and one for continuous random variables. The theorems give the formulas for finding the probability density function (pdf) of the transformed random variable(s). Several examples are then worked through to demonstrate applying the transformation method and finding the pdfs of transformed random variables.

Uploaded by

yazan a
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

Lectures 7 & 8

Transformation Method

Theorem (1): Let 𝑋 be a random variable with 𝑝𝑑𝑓 𝑓𝑋 (𝑥) and let 𝑌 = 𝑢(𝑋) be a

function of 𝑋. Assume that 𝑦 = 𝑢(𝑥) defines a one-to-one

transformation from 𝐴 = {𝑥: 𝑓𝑋 (𝑥) > 0} onto 𝐵 = {𝑦: 𝑔𝑌 (𝑦) >

0} with inverse transformation 𝑥 = 𝑤(𝑦):

1. If 𝑋 is a discrete random variable, then the 𝑝𝑑𝑓 of 𝑌 is,

𝑓 (𝑤(𝑦)) , 𝑦 ∈ 𝐵
𝑔𝑌 (𝑦) = { 𝑋
0 , 𝑜. 𝑤

2. If 𝑋 is a continuous random variable, then the 𝑝𝑑𝑓 of 𝑌 is,

𝑑
𝑓𝑋 (𝑤(𝑦)) | 𝑤(𝑦)| , 𝑦 ∈ 𝐵
𝑔𝑌 (𝑦) = { 𝑑𝑦
0 , 𝑜. 𝑤

𝑑
Provided that 𝑤(𝑦) ≠ 0.
𝑑𝑦

Example 1: Let 𝑋 be a random variable has a geometric 𝑝𝑑𝑓 given by

(1 − 𝑝)𝑥−1 𝑝 , 𝑥 = 1, 2, , 3, …
𝑓𝑋 (𝑥) = {
0 , 𝑜. 𝑤

Use the transformation method to find the 𝑝𝑑𝑓 of 𝑌 = 𝑋 − 1.

Solution:

𝐴 = {𝑥: 𝑓𝑋 (𝑥) > 0} = {𝑥: 𝑥 = 1, 2, , 3, … }

The transformation 𝑦 = 𝑥 − 1 maps 𝐴 onto

𝐵 = {𝑦: 𝑔𝑌 (𝑦) > 0} = {𝑦: 𝑦 = 0, 1, 2, , … }

1
Since 𝑦 = 𝑥⏟− 1 then the inverse transformation is
𝑢(𝑥)
𝑥 = 𝑦⏟+ 1
𝑤(𝑦)
The 𝑝𝑑𝑓 of 𝑌 is,

𝑓 (𝑤(𝑦)) = 𝑓𝑋 (𝑦 + 1), 𝑦 ∈ 𝐵
𝑔𝑌 (𝑦) = { 𝑋
0 , 𝑜. 𝑤

(1 − 𝑝)𝑦+1−1 𝑝, 𝑦∈𝐵
={
0 , 𝑜. 𝑤
(1 − 𝑝)𝑦 𝑝, 𝑦 = 0, 1, 2, , …
={
0 , 𝑜. 𝑤
Example 2: Let 𝑋 be a random variable with 𝑝𝑑𝑓 𝑏𝑖𝑛(𝑛, 𝑝). Find the 𝑝𝑑𝑓 of

𝑌 = 𝑛 − 𝑋.

Solution:

𝑛
( ) 𝑝 𝑥 (1 − 𝑝)𝑛−𝑥 , 𝑥 = 0, 1, 2, … , 𝑛
𝑓𝑋 (𝑥) = { 𝑥
0 , 𝑜. 𝑤

Therefore,

𝐴 = {𝑥: 𝑓𝑋 (𝑥) > 0} = {𝑥: 𝑥 = 0, 1, 2, … , 𝑛}

The transformation 𝑦 = 𝑛 − 𝑥 maps 𝐴 onto

𝐵 = {𝑦: 𝑔𝑌 (𝑦) > 0} = {𝑦: 𝑦 = 0, 1, 2, … , 𝑛}

Since 𝑦 = 𝑛⏟− 𝑥 then the inverse transformation is


𝑢(𝑥)
𝑥 = 𝑛⏟− 𝑦
𝑤(𝑦)
The 𝑝𝑑𝑓 of 𝑌 is,

𝑓 (𝑤(𝑦)) = 𝑓𝑋 (𝑛 − 𝑦), 𝑦 ∈ 𝐵
𝑔𝑌 (𝑦) = { 𝑋
0 , 𝑜. 𝑤

2
𝑛
(𝑛 − 𝑦) 𝑝𝑛−𝑦 (1 − 𝑝)𝑛−(𝑛−𝑦) , 𝑦 ∈ 𝐵
={
0 , 𝑜. 𝑤
𝑛
(𝑦) 𝑝𝑛−𝑦 (1 − 𝑝)𝑦 , 𝑦 = 0, 1, 2, … , 𝑛
={
0 , 𝑜. 𝑤
That is, 𝑌~𝑏𝑖𝑛(𝑛, 1 − 𝑝).
𝑛 𝑛! 𝑛! 𝑛
Note that: (𝑛 − 𝑦) = = = (𝑦).
(𝑛−(𝑛−𝑦))!(𝑛−𝑦)! 𝑦!(𝑛−𝑦)!

Example 3: Let 𝑋 be a random variable with 𝑝𝑑𝑓

(𝑥) 2𝑒 −2𝑥 , 𝑥>0


𝑓𝑋 ={
0 , 𝑜. 𝑤
Find the 𝑝𝑑𝑓 of 𝑌 = 𝑒 𝑋 .

Solution:
𝐴 = {𝑥: 𝑓𝑋 (𝑥) > 0} = {𝑥: 𝑥 > 0}
The transformation 𝑦 = 𝑒 𝑥 maps 𝐴 onto
𝐵 = {𝑦: 𝑔𝑌 (𝑦) > 0} = {𝑦: 𝑦 > 1}
𝑦 = 𝑒 𝑥 then the inverse transformation is
Since 𝑦 = ⏟
𝑢(𝑥)
𝑥 = 𝑙𝑛
⏟(𝑦)
𝑤(𝑦)
𝑑 𝑑𝑥 1
and 𝑤(𝑦) = = . Therefore, the 𝑝𝑑𝑓 of 𝑌 is,
𝑑𝑦 𝑑𝑦 𝑦
𝑑 1
𝑓𝑋 (𝑤(𝑦)) | 𝑤(𝑦)| = 𝑓𝑋 (𝑙𝑛(𝑦)) | | , 𝑦∈𝐵
𝑔𝑌 (𝑦) = { 𝑑𝑦 𝑦
0 , 𝑜. 𝑤
1
2𝑒 −2𝑙𝑛(𝑦) , 𝑦 ∈ 𝐵
={ 𝑦
0 , 𝑜. 𝑤
2
, 𝑦>1
= {𝑦 3
0 , 𝑜. 𝑤

3
Theorem (2): Let 𝑋1 and 𝑋2 be two random variables with joint 𝑝𝑑𝑓 𝑓(𝑥1 , 𝑥2 )

and let 𝑌1 = 𝑢1 (𝑋1 , 𝑋2 ) and 𝑌2 = 𝑢2 (𝑋1 , 𝑋2 ) are two functions of 𝑋1 and 𝑋2 .

Assume that 𝑦1 = 𝑢1 (𝑥1 , 𝑥2 ) and 𝑦2 = 𝑢2 (𝑥1 , 𝑥2 ) defines one-to-one

transformation from 𝐴 = {(𝑥1 , 𝑥2 ) ∶ 𝑓(𝑥1 , 𝑥2 ) > 0} onto 𝐵=

{(𝑦1 , 𝑦2 ): 𝑔(𝑦1 , 𝑦2 ) > 0} with inverse transformation 𝑥1 = 𝑤1 (𝑦1 , 𝑦2 ) and

𝑥2 = 𝑤2 (𝑦1 , 𝑦2 ):

1. If 𝑋1 and 𝑋2 are discrete random variables, then the joint 𝑝𝑑𝑓 of 𝑌1 and 𝑌2 is,

𝑓[𝑤1 (𝑦1 , 𝑦2 ), 𝑤2 (𝑦1 , 𝑦2 ) ] , (𝑦1 , 𝑦2 ) ∈ 𝐵


𝑔(𝑦1 , 𝑦2 ) = {
0 , 𝑜. 𝑤

2. If 𝑋1 and 𝑋2 are continuous random variables, then the joint 𝑝𝑑𝑓 of 𝑌1 and 𝑌2

is,

𝑓[𝑤1 (𝑦1 , 𝑦2 ), 𝑤2 (𝑦1 , 𝑦2 ) ]|𝐽| , (𝑦1 , 𝑦2 ) ∈ 𝐵


𝑔(𝑦1 , 𝑦2 ) = {
0 , 𝑜. 𝑤

Provided 𝐽 ≠ 0. Where 𝐽 is called the Jacobian and is given by

𝑑𝑤1 (𝑦1 , 𝑦2 ) 𝑑𝑤1 (𝑦1 , 𝑦2 ) 𝑑𝑥1 𝑑𝑥1


𝑑𝑦1 𝑑𝑦2 || = ||𝑑𝑦1 𝑑𝑦2
𝐽 = || |
𝑑𝑤2 (𝑦1 , 𝑦2 ) 𝑑𝑤2 (𝑦1 , 𝑦2 ) 𝑑𝑥2 𝑑𝑥2 |
𝑑𝑦1 𝑑𝑦2 𝑑𝑦1 𝑑𝑦2

𝑎 𝑏
Note that: | | = 𝑎𝑑 − 𝑏𝑐 , which is the determinant of the matrix
𝑐 𝑑

𝑎 𝑏
[ ].
𝑐 𝑑

4
Example 4: The joint 𝑝𝑑𝑓 of 𝑋1 and 𝑋2 is,

2 𝑥1+𝑥2 1 2−𝑥1−𝑥2
𝑓(𝑥1 , 𝑥2 ) = {(3) ( ) , (𝑥1 , 𝑥2 ) = (0,0), (0,1), (1,0), (1,1)
3
0 , 𝑜. 𝑤
1. Find the marginal 𝑝𝑑𝑓 of 𝑋1 .
2. Find the marginal 𝑝𝑑𝑓 of 𝑋2 .
3. Find joint 𝑝𝑑𝑓 of 𝑌1 = 𝑋1 − 𝑋2 and 𝑌2 = 𝑋1 + 𝑋2 .
4. Find the marginal 𝑝𝑑𝑓 of 𝑌1 .
5. Find the marginal 𝑝𝑑𝑓 of 𝑌2 .
Solution: First, note that the range (𝑥1 , 𝑥2 ) = (0,0), (0,1), (1,0), (1,1)

equivalent to 𝑥1 = 0, 1, 𝑥2 = 0, 1.

1. The marginal 𝑝𝑑𝑓 of 𝑋1 is,

𝑓𝑋1 (𝑥1 ) = ∑ 𝑓(𝑥1 , 𝑥2 ) , 𝑥1 = 0, 1


∀𝑥2
𝟏
2 𝑥1+𝑥2 1 2−𝑥1−𝑥2
= ∑( ) ( )
3 3
𝑥2 =𝟎

2 𝑥1 1 2−𝑥1 2 𝑥1+1 1 2−𝑥1−1


=( ) ( ) +( ) ( )
3 3 3 3
2 𝑥1 1 1−𝑥1 1 2
=( ) ( ) ( + )
3 3 3 3
2 𝑥1 1 1−𝑥1
= {(3) (3) , 𝑥1 = 0, 1
0 , 𝑜. 𝑤
2
Note that: 𝑋1 ~𝑏𝑖𝑛(1, )
3

1. The marginal 𝑝𝑑𝑓 of 𝑋2 is,

𝑓𝑋2 (𝑥2 ) = ∑ 𝑓(𝑥1 , 𝑥2 ) , 𝑥2 = 0, 1


∀𝑥1

5
𝟏
2 𝑥1+𝑥2 1 2−𝑥1−𝑥2
= ∑( ) ( )
3 3
𝑥1 =𝟎

2 0+𝑥2 1 2−0−𝑥2 2 1+𝑥2 1 2−1−𝑥2


=( ) ( ) +( ) ( )
3 3 3 3
2 𝑥2 1 1−𝑥2 1 2
=( ) ( ) ( + )
3 3 3 3
2 𝑥2 1 1−𝑥2
= {(3) (3) , 𝑥2 = 0, 1
0 , 𝑜. 𝑤
2
Note that: 𝑋2 ~𝑏𝑖𝑛(1, )
3

3.

𝐴 = {(𝑥1 , 𝑥2 ): 𝑓(𝑥1 , 𝑥2 ) > 0} = {(𝑥1 , 𝑥2 ): (𝑥1 , 𝑥2 ) = (0,0), (0,1), (1,0), (1,1)}

= {(𝑥1 , 𝑥2 ): 𝑥1 = 0, 1, 𝑥2 = 0, 1}

The transformation 𝑦1 = 𝑥1 − 𝑥2 and 𝑦2 = 𝑥1 + 𝑥2 maps 𝐴 onto

𝐵 = {(𝑦1 , 𝑦2 ): 𝑔(𝑦1 , 𝑦2 ) > 0}

= {(𝑦1 , 𝑦2 ): (𝑦1 , 𝑦2 ) = (0,0), (−1,1), (1,1), (0,2)} (has 4 pairs)

≠ {(𝑦1 , 𝑦2 ): 𝑦1 = −1,0,1, 𝑦2 = 0,1,2} (has 9 pairs)

𝑦1 = 𝑥1 − 𝑥2 and 𝑦2 = 𝑥1 + 𝑥2

𝑦1 = 𝑢1 (𝑥1 , 𝑥2 ) and 𝑦2 = 𝑢2 (𝑥1 , 𝑥2 )

Since 𝑦1 = 𝑥
⏟1 − 𝑥2 and 𝑦2 = 𝑥 ⏟1 + 𝑥2 then the inverse transformation can be
𝑢1 (𝑥1 , 𝑥2 ) 𝑢2 (𝑥1 , 𝑥2 )

obtained as follows,

6
𝑦1 = 𝑥1 − 𝑥2 ⟹ 𝑥2 = 𝑥1 − 𝑦1
𝑦2 = 𝑥1 + 𝑥2 ⟹ 𝑥2 = 𝑦2 − 𝑥1 } ⟹ 𝑥1 − 𝑦1 = 𝑦2 − 𝑥1 ⟹ 𝑥1 = (𝑦
⏟ 1 + 𝑦2 )/2
𝑤1 (𝑦1 , 𝑦2 )

and
𝑥2 = (𝑦
⏟ 2 − 𝑦1 )/2
𝑤2 (𝑦1 , 𝑦2 )

The joint 𝑝𝑑𝑓 of 𝑌1 and 𝑌2 is,

𝑓[𝑤1 (𝑦1 , 𝑦2 ), 𝑤2 (𝑦1 , 𝑦2 ) ] , (𝑦1 , 𝑦2 ) ∈ 𝐵


𝑔(𝑦1 , 𝑦2 ) = {
0 , 𝑜. 𝑤
𝑦1 + 𝑦2 𝑦2 − 𝑦1
𝑓( , ) , (𝑦1 , 𝑦2 ) ∈ 𝐵
={ 2 2
0 , 𝑜. 𝑤
𝑦1+𝑦2 𝑦2 −𝑦1 𝑦1 +𝑦2 𝑦2 −𝑦1
+
2 2 2 1 2− 2

2
= {(3) ( ) , (𝑦1 , 𝑦2 ) ∈ 𝐵
3
0 , 𝑜. 𝑤
2 𝑦2 1 2−𝑦2
= { (3) (3) , (𝑦1 , 𝑦2 ) = (0,0), (−1,1), (1,1), (0,2)
0 , 𝑜. 𝑤
4. The marginal 𝑝𝑑𝑓 of 𝑌1 is,

𝑔𝑌1 (𝑦1 ) = ∑ 𝑔(𝑦1 , 𝑦2 ) , 𝑦1 = −1, 0, 1


∀𝑦2

Since the values of 𝑦1 should be −1, 0, 1 then we cannot sum over the

values of 𝑦2 = 0, 1, 2 for each value of 𝑦1 (because in this case we are

adding 9 pairs, not 4). To be correct, if 𝑦1 = −1 then 𝑦2 takes only one

value, which is 𝑦2 = 1. If 𝑦1 = 0 then 𝑦2 = 0, 2 and if 𝑦1 = 1 then 𝑦2 = 1.

Therefore,

7
𝟏
2 1 1 2−1 2
𝑔𝑌1 (−1) = ∑ 𝑔(−1, 𝑦2 ) = 𝑔(−1,1) = ( ) ( ) =
3 3 9
𝑦2 =1

1 4 5
𝑔𝑌1 (0) = ∑ 𝑔(0, 𝑦2 ) = 𝑔(0,0) + 𝑔(0,2) = + =
9 9 9
𝑦2 =𝟎,𝟐

𝟏
2
𝑔𝑌1 (1) = ∑ 𝑔(1, 𝑦2 ) = 𝑔(1,1) =
9
𝑦2 =1

Thus, the marginal 𝑝𝑑𝑓 of 𝑌1 is summarized in the following table,

𝒚𝟏 -1 0 1 o.w

𝒈𝒀𝟏 (𝒚𝟏 ) 2/9 5/9 2/9 0

5. You can solve this part by the same technique of the previous part.

Example 5: Let 𝑋1 , 𝑋2 be a random sample from 𝑒𝑥𝑝(1) (See also Example 6 of

Lectures 5 and 6).

1. Find the joint 𝑝𝑑𝑓 of 𝑌1 = 𝑋1 + 𝑋2 and 𝑌2 = 𝑋1 − 𝑋2 .

2. Find the marginal 𝑝𝑑𝑓 of 𝑌1 = 𝑋1 + 𝑋2 .

3. Find the marginal 𝑝𝑑𝑓 of 𝑌2 = 𝑋1 − 𝑋2 .

Solution: The joint 𝑝𝑑𝑓 of 𝑋1 and 𝑋2 is,


𝑒 −(𝑥1+𝑥2) , 𝑥1 > 0, 𝑥2 > 0
𝑓(𝑥1 , 𝑥2 ) = {
0 , 𝑜. 𝑤
𝐴 = {(𝑥1 , 𝑥2 ): 𝑓(𝑥1 , 𝑥2 ) > 0} = {(𝑥1 , 𝑥2 ): 𝑥1 > 0, 𝑥2 > 0}

Since 𝑦1 = 𝑥1 + 𝑥2 (= 𝑢1 (𝑥1 , 𝑥2 )) and 𝑦2 = 𝑥1 − 𝑥2 (= 𝑢2 (𝑥1 , 𝑥2 )), then the

inverse transformation is,

8
𝑦1 −𝑦2 𝑦1 +𝑦2
𝑥1 = (= 𝑤1 (𝑦1 , 𝑦2 )) and 𝑥2 = (= 𝑤2 (𝑦1 , 𝑦2 )) (See Example 4,
2 2

Part3).
To determine the set 𝑩:

We know that 𝑥1 > 0 , 𝑥2 > 0, which gives

𝑦1 = 𝑥1 + 𝑥2 > 0 and −∞ < 𝑦2 = 𝑥1 − 𝑥2 < ∞. In addition, we will try to

discover if the two random variables depends on each other or not,


𝑦1 − 𝑦2
𝑥1 > 0 ⟹ > 0 ⟹ 𝑦1 > 𝑦2
2
𝑦1 + 𝑦2
𝑥2 > 0 ⟹ > 0 ⟹ 𝑦1 > −𝑦2
2
Therefore,

𝐵 = {(𝑦1 , 𝑦2 ): 𝑔(𝑦1 , 𝑦2 ) > 0}


= {(𝑦1 , 𝑦2 ): 𝑦1 > 0, −∞ < 𝑦2 < ∞, 𝑦1 > 𝑦2 , 𝑦1 > −𝑦2 }.
The Jacobian 𝐽 is,
𝑑𝑥1 𝑑𝑥1 1 1

𝑑𝑦
𝐽 = || 1
𝑑𝑦2
|| = |2 2| = (1) (1) − (− 1) (1) = 1
𝑑𝑥2 𝑑𝑥2 1 1 2 2 2 2 2
𝑑𝑦1 𝑑𝑦2 2 2
The joint 𝑝𝑑𝑓 of 𝑌1 and 𝑌2 is,

𝑓[𝑤1 (𝑦1 , 𝑦2 ), 𝑤2 (𝑦1 , 𝑦2 )]|𝐽| , (𝑦1 , 𝑦2 ) ∈ 𝐵


𝑔(𝑦1 , 𝑦2 ) = {
0 , 𝑜. 𝑤
𝑦1 − 𝑦2 𝑦1 + 𝑦2 1
= {𝑓 ( , ) , (𝑦1 , 𝑦2 ) ∈ 𝐵
2 2 2
0 , 𝑜. 𝑤
−(
𝑦1 −𝑦2 𝑦1 +𝑦2
+ ) 1
(𝑦1 , 𝑦2 ) ∈ 𝐵
= {𝑒 ,
2 2
2
0 , 𝑜. 𝑤
1 −𝑦
= {2 𝑒
1 , 𝑦1 > 0, −∞ < 𝑦2 < ∞, 𝑦1 > 𝑦2 , 𝑦1 > −𝑦2
0 , 𝑜. 𝑤

9
The set 𝐵 can be represent graphically as given below:

𝒚𝟐

y1=y2

𝒚𝟏

y1=-y2

2. The marginal 𝑝𝑑𝑓 of 𝑌1 is,

𝑔𝑌1 (𝑦1 ) = ∫ 𝑔(𝑦1 , 𝑦2 )𝑑𝑦2 , 𝑦1 > 0


𝑅𝑦2

𝑦1
1 −𝑦
=∫ 𝑒 1 𝑑𝑦2
−𝑦1 2

𝑦 𝑒 −𝑦1 , 𝑦1 > 0
={ 1
0 , 𝑜. 𝑤

10
3. The marginal 𝑝𝑑𝑓 of 𝑌2 is,

𝑔𝑌2 (𝑦2 ) = ∫ 𝑔(𝑦1 , 𝑦2 )𝑑𝑦1 , −∞ < 𝑦2 < ∞


𝑅𝑦1


1 −𝑦
∫ 𝑒 1 𝑑𝑦1 , 𝑦2 < 0
−𝑦2 2
= ∞
1 −𝑦
∫ 𝑒 1 𝑑𝑦1 , 𝑦2 > 0
{ 𝑦2 2

𝑦
𝑒 2
, 𝑦2 < 0
= { −𝑦22
𝑒
, 𝑦2 > 0
2
|𝑦 |
𝑒 2
= , −∞ < 𝑦2 < ∞
2
---------------------------------------------------------------------------------------------------------

Assignment # 2

Q1: Let 𝑋 be a random variable with 𝑝𝑑𝑓 𝑁(0,1). Find the 𝑝𝑑𝑓 of 𝑌 = 𝑋 2 .

Q2: Let 𝑋1 , 𝑋2 be a random sample from 𝑈(0,1).

1. Use the distribution function method to find the 𝑝𝑑𝑓 of 𝑌1 = 𝑋1 + 𝑋2 .

2. Use the transformation method to find the 𝑝𝑑𝑓 of 𝑌1 = 𝑋1 + 𝑋2 .

Q3: The joint 𝑝𝑑𝑓 of 𝑋1 , 𝑋2 is

0.5 , 0 < 𝑥1 < 1, 0 < 𝑥2 < 2


𝑓(𝑥) = {
0 , 𝑜. 𝑤

Use the transformation method to find the joint 𝑝𝑑𝑓 of 𝑌1 = 𝑋1 + 𝑋2 and

𝑌2 = 𝑋2 .

11

You might also like