You are on page 1of 21

Functions of one Random Variable

1 aX + b
X X2

sin X Y = g(X ) |X |

X
log X
eX | X |U ( x)
Functions of a Random Variable

X: a r.v defined on the model (  , F , P ),


g(X): a function of the variable x, Y = g ( X ).

▪ Is Y necessarily a r.v?
▪ If so what is its PDF FY ( y ), pdf fY ( y ) ?
Functions of a Random Variable
▪ If X is a r.v, so is Y, and for every Borel set B,
P (Y  B ) = P ( X  g −1 ( B )).

▪ With Y ( )  B , In particular

FY ( y ) = P (Y ( )  y ) = P ( g ( X ( ))  y )
( ) (
= P X ( )  g −1 ( y ) = P X ( )  g −1 ( −, y ] .)
▪ To obtain the distribution function of Y, we must determine the Borel set on
the x-axis such that X ( )  g −1 ( y ) for every given y, and the probability of
that set.
Example: Y = aX + b

▪ For a  0 : ▪ For a  0,

FY ( y ) = P(Y ( )  y ) FY ( y ) = P (Y ( )  y )
= P(aX ( ) + b  y ) = P(aX ( ) + b  y )
 y −b  y −b
= P X ( )   = P X ( )  
 a   a 
 y −b  y −b
= FX  . = 1 − FX   ,
 a   a 

1  y −b 1  y−b
And f Y ( y ) = fX  . and hence fY ( y ) = − fX  .
a  a  a  a 

1  y−b
We conclude: fY ( y ) = fX  .
|a |  a 
Example: Y = X 2

FY ( y ) = P (Y ( )  y ) = P ( X 2 ( )  y ) .
▪ For y  0,

X 2
( )  y  =  ,

FY ( y ) = 0, y  0.

▪ For y  0, according to the figure, Y = X2


y

▪ the event {Y ( )  y} = { X ( )  y}
2

is equivalent to { x1  X ( )  x 2 }. x1 x2 X
Example: Y = X 2 - continued

FY ( y ) = P ( x1  X ( )  x2 ) = FX ( x2 ) − FX ( x1 )
= FX ( y ) − FX ( − y ), y  0.

 1
 ( )
f ( y ) + f X (− y ) ,
fY ( y ) =  2 y X
y  0,
 0, otherwise .

▪ If f X ( x ) represents an even function,

fY ( y ) =
1
y
fX ( y ) U ( y ).
Example: Y = X 2 - continued

1 − x2 / 2
▪ If X ~ N ( 0 ,1), so that f X ( x ) = e ,
2

▪ We obtain the p.d.f of Y = X 2 to be

1
fY ( y ) = e − y / 2U ( y ).
2y

▪ which represents a Chi-square r.v with n = 1, since  (1 / 2 ) =  .

▪ Thus, if X is a Gaussian r.v with  = 0, then Y = X2 represents a


Chi-square r.v with one degree of freedom (n = 1).
Example

 X − c, X  c, g( X )
▪ For: 
Y = g ( X ) =  0, − c  X  c, −c
X
 X + c,
c
 X  − c.

▪ Find the distribution and density function wrt Y.


Example

 X − c, X  c, g( X )
▪ For: 
Y = g ( X ) =  0, − c  X  c, −c
X
 X + c,
c
 X  − c.

▪ We have P (Y = 0 ) = P ( − c  X ( )  c ) = FX ( c ) − FX ( − c ).

▪ For y  0 , we have x  c , and Y ( ) = X ( ) − c so that

FY ( y ) = P (Y ( )  y ) = P ( X ( ) − c  y )
= P ( X ( )  y + c ) = FX ( y + c ), y  0.

▪ For y  0, we have x  − c , and Y ( ) = X ( ) + c so that

FY ( y ) = P (Y ( )  y ) = P ( X ( ) + c  y )
= P ( X ( )  y − c ) = FX ( y − c ), y  0.
Example – continued

▪ Thus,

 f X ( y + c ), y  0,

fY ( y ) = [ FX ( c ) − FX ( − c )] ( y ),
 f ( y − c ), y  0.
 X

FX ( x ) FY ( y )
g( X )
−c
c X x y
Continuous Functions of a Random Variable

▪ A continuous function g(x)


▪ g (x ) nonzero at all but a finite number of points
▪ has only a finite number of maxima and minima
▪ eventually becomes monotonic as | x |→  .
▪ Consider a specific y on the y-axis, and a positive increment y

g ( x)
y + y
y

x
x1 x1 + x1 x3 x3 + x3
x2 +  x2 x2
Continuous Functions of a Random Variable
▪ For f Y ( y ) Y = g ( X ) where g () is of continuous type,
y + y
P y  Y ( )  y +  y  =  f Y ( u ) du  f Y ( y )   y .
y

▪ y = g ( x ) has three solutions x1 , x2 , x3 when y  Y ( )  y +  y ,

▪ X could be in any one of three disjoint intervals: g ( x)

{x1  X ( )  x1 + x1}, y + y

{x2 + x2  X ( )  x2 }
y

x
or {x3  X ( )  x3 + x3 } . x1 x1 + x1 x3 x3 + x3
x2 +  x2 x2

So,
Py  Y ( )  y + y  = P{ x1  X ( )  x1 + x1}
+ P{ x2 + x2  X ( )  x2 } + P{ x3  X ( )  x3 + x3} .
Continuous Functions of a Random Variable

▪ For small y , xi , we get


f Y ( y )  y = f X ( x1 )  x1 + f X ( x 2 )( −  x 2 ) + f X ( x3 )  x3 .

▪ Here,  x1  0,  x2  0 and x3  0, so


|  xi | 1
fY ( y ) =  f X ( xi ) = f X ( xi )
i y i  y /  xi

▪ As y → 0,
1 1
fY ( y ) =  f X ( xi ) =  f X ( xi ).
i dy / dx x i g ( xi )
i

▪ If the solutions are all in terms of y, the right side is only a function of y.
Example Y = X 2
Revisited

▪ For all y  0, x1 = − y and x2 = + y Y = X2


y

▪ f Y ( y ) = 0 for y  0 . X
x1 x2
dy dy
▪ Moreover = 2 x so that =2 y
dx dx x = xi

1
▪ and using f Y ( y ) =  f X ( xi ) ,
i 
g ( xi )

 1
 (
f ( y ) + f X (− y ) ,
fY ( y ) =  2 y X
)
y  0,

 0, otherwise ,

which agrees with previous solution.


1
Example: Y =
X

▪ Find fY ( y ).

▪ Here for every y, x1 = 1 / y is the only solution, and

dy 1 dy 1
= − 2 so that = 2
= y 2
,
dx x dx x = x1 1/ y

1
▪ and substituting this into fY ( y ) =  f X ( xi ) , we obtain
i g ( xi )

1 1
fY ( y ) = 2 f X  .
y  y
Example

▪ Suppose f X ( x ) = 2 x /  2 , 0  x   , and Y = sin X . Determine fY ( y ).

▪ X has zero probability of falling outside the interval ( 0,  ).


▪ y = sin x has zero probability of falling outside ( 0,1).
▪ f Y ( y ) = 0 outside this interval.

▪ For any 0  y  1, the equation y = sin x has an infinite number of


solutions  , x1 , x2 , x3 ,  , where x1 = sin −1 y is the principal solution.

▪ using the symmetry we also get x2 =  − x1 etc. Further,


dy
= cos x = 1 − sin 2 x = 1 − y 2
dx
▪ so that
dy
= 1 − y2 .
dx x = xi
Example – continued
f X ( x)

x3
x
(a) 
y = sin x

x
x −1 x1 x2 x3

(b)

+
▪ for 0  y  1, 1
fY ( y ) =  f X ( xi ).
i =− 1− y 2
i 0

▪ In this case f X ( x−1 ) = f X ( x3 ) = f X ( x4 ) =  = 0


▪ (Except for f X ( x1 ) and f X ( x2 ) the rest are all zeros).
Example – continued

▪ Thus,

 2 x1 2 x2 
fY ( y ) =
1
( f X ( x1 ) + f X ( x2 ) ) =
1
 2 + 2 
1− y 2
1− y  
2  
 2
2( x1 +  − x1 )  , 0  y  1,
= =  1 − y 2
 2 1 − y2  0, otherwise.

fY ( y )

2
 y
1
Example: Y = tan X , X  (−  / 2,  / 2 ) .

▪ As x moves in (−  / 2,  / 2 ) , y moves in (−  , +  ) .
▪ The function Y = tan X is one-to-one for −  / 2  x   / 2 .
f X ( x)
−1
▪ For any y, x1 = tan y is the principal solution.
x
− /2  /2

dy d tan x
= = sec 2 x = 1 + tan 2 x = 1 + y 2 y = tan x
dx dx
y
− /2
x
1 1/  x1  / 2
fY ( y ) = f X ( x1 ) = , −   y  +
| dy / dx | x = x1 1+ y 2

(Cauchy density function with parameter equal to unity)

1
fY ( y ) =
1 + y2

y
Functions of a Discrete-type R.V

▪ Suppose X is a discrete-type r.v with


P ( X = xi ) = pi , x = x1 , x 2 ,  , xi , 
▪ and Y = g ( X ).

▪ Clearly Y is also of discrete-type, and when x = xi , y i = g ( xi ),


and for those yi s,

P (Y = y i ) = P ( X = xi ) = pi , y = y1 , y 2 ,  , yi , 
Example

▪ Suppose X ~ P (  ), so that

− k
P( X = k ) = e , k = 0,1,2, 
k!

▪ Define Y = X 2 + 1 . Find the p.m.f of Y.

▪ Solution: X takes the values 0,1,2 ,  , k , 


▪ Y only takes the values 1, 2, 5, , k 2 + 1,

P (Y = k 2 + 1) = P ( X = k )

▪ so that for j = k 2 + 1
 j −1
(
P (Y = j ) = P X = )
j − 1 = e−
( j − 1)!
, j = 1, 2, 5, , k 2 + 1, .

You might also like