Você está na página 1de 7

Introduction One Function of Random Variables

Functions of a Random Variable: Density

 Let g(x) = y be a one-to-one function whose derivative is nonzero

Math 425
Intro to Probability
Lecture 30

on some region A of the real line.


Suppose g maps A onto B, so that there is an inverse map
x = h(y ) from B back to A.

 Let X be a continuous random variable with known density f (x).

Kenneth Harris
kaharri@umich.edu

Let Y = G(X ). Then the density of Y is

Department of Mathematics
University of Michigan


 d

fY (y ) = fX h(y ) h(y ) .
dt

April 3, 2009
Note: Compare to Ross, Theorem 5.7.1, page 243.

Kenneth Harris (Math 425)

Math 425 Intro to Probability Lecture 30

April 3, 2009

1 / 32

Kenneth Harris (Math 425)

Two Functions of Two Random Variables

April 3, 2009

3 / 32

Two Functions of Two Random Variables

Problem

Definition Nice Transformations

Let the continuous random variables (X , Y ) have joint density


fX ,Y (x, y ) and let A = {(x, y ) : fX ,Y (x, y ) > 0}.
(X , Y ) determines a point with xy -coordinates in the region A.

Definition
A transformation from xy -coordinates to uv -coordinates (xy uv )
given by

 Consider the continuous random variables (U, V ) given by


U = g1 (X , Y )

u = g1 (x, y )

(U, V ) determines a point with uv -coordinates in some region B.


Problem. If the transformation from xy -coordinates to uv -coordinates
given by
u = g1 (x, y )
v = g2 (x, y ).
is nice on A, then we can produce the joint density fU,V (u, v ) for the
random variable (U, V ).
Math 425 Intro to Probability Lecture 30

v = g2 (x, y ).

is nice on A, if

V = g2 (X , Y ).

Kenneth Harris (Math 425)

Math 425 Intro to Probability Lecture 30

April 3, 2009

u v
v
The partial derivatives u
x , y , x , and y exist and are continuous
on A.
The Jacobian of the transformation is nonzero on A:


u
x
J(x, y ) = v
x

u
y
v
y

u v
u v

6= 0
x y
y x

whenever (x, y ) A.
5 / 32

Kenneth Harris (Math 425)

Math 425 Intro to Probability Lecture 30

April 3, 2009

6 / 32

Two Functions of Two Random Variables

Two Functions of Two Random Variables

Change of coordinates

Jacobians

 A nice transformation on A (xy uv ) amounts to simply a change

of coordinates of the plane from xy -coordinates to uv -coordinates.


We can recover the original xy -coordinates from the new
uv -coordinates.


u
x
J(x, y ) = v
x

u
y
v
y

v = g2 (x, y )

x

J(u, v ) = u
y

x
v
y
v

to uv -coordinates on a region B.
There is a reverse transformation (uv xy ) from uv -coordinates to
xy -coordinates
x = h1 (u, v )
y = h2 (u, v ).

Math 425 Intro to Probability Lecture 30

u v
u v

x y
y x

x y
x y

u v
v u

 Since (xy uv ) is nice on A,

J(x, y ) 6= 0 whenever (x, y ) A and


J(u, v ) 6= 0 whenever (u, v ) B.

Furthermore, the two Jacobian determinants are inverses

which maps B onto A and which are also nice on B.


Kenneth Harris (Math 425)


The Jacobian of the inverse transformation (uv xy ) is the
determinant

 Suppose (xy uv ) is nice transformation on A


u = g1 (x, y )


The Jacobian of the original transformation (xy uv ) is the
determinant

J(x, y ) = J(u, v )1
April 3, 2009

7 / 32

Two Functions of Two Random Variables

Kenneth Harris (Math 425)

Math 425 Intro to Probability Lecture 30

April 3, 2009

8 / 32

Two Functions of Two Random Variables

Main Theorem

Picture of Theorem

Theorem

fU,V (u, v ) du dv P {(U, V ) B}




Let (X , Y ) be continuous random variables with joint density fX ,Y (x, y ), and


(U, V ) be random variables given by
U = g1 (X , Y )



P {(X , Y ) A} fX ,Y (x, y ) J(u, v ) du dv

V = g2 (X , Y ).

Suppose the (xy uv ) transformation


u = g1 (x, y )

v = g2 (x, y ).

is nice on A = {(x, y ) : fX ,Y (x, y ) 6= 0}.


Let the inverse (uv xy ) from B to A be
x = h1 (u, v )

UV

XY

P8HU,VLDB<

P8HX,YLDA<

DB

y = h2 (u, v ).

 The joint density of (U, V ) is given for (u, v ) B by either equation

Hu,vL

DA

Hx,yL

dv

du

fU,V (u, v ) = fX ,Y h1 (u, v ), h2 (u, v ) J(u, v )




fU,V (u, v ) = fX ,Y h1 (u, v ), h2 (u, v ) J(x, y )1

Area of DB = dudv

Area of DA = JHu,vLdudv

whichever is more convenient to compute.


Kenneth Harris (Math 425)

Math 425 Intro to Probability Lecture 30

April 3, 2009

9 / 32

Kenneth Harris (Math 425)

Math 425 Intro to Probability Lecture 30

April 3, 2009

10 / 32

Two Functions of Two Random Variables

Example

Sketch of Proof of Theorem

Functions of a Random Variable: Density

 Let B B and suppose (uv xy ) maps B to A A.


P {(U, V ) B}

Example. Let X and Y be continuous random variables with joint


density fX ,Y (x, y ) and where X 6= 0. Consider

= P {(X , Y ) A}
Z Z
=
fX ,Y (x, y ) dx dy
(x,y )A
Z Z


=
fX ,Y h1 (u, v ), h2 (u, v ) J(u, v ) du dv

using the Change of Variables Theorem of analysis.

 Intuitively, we can break B into small regions B which (uv xy )

y=

u
.
v

The Jacobian for transformation for (uv xy ) is




1
0
1
v =
J(u, v ) =
1 vu2
v

fX ,Y h1 (u, v ), h2 (u, v ) J(u, v ) if (u, v ) B


0
otherwise.
April 3, 2009

v = x.

x =v

 Differentiate the(integrals to get the transformation


rule:


Math 425 Intro to Probability Lecture 30

u = xy

The inverse transformation (uv xy ) is given by

transforms to small regions A of A where for any (u, v ) B:




fU,V (u, v ) Area B fX ,Y (h1 (u, v ), h2 (u, v )) Area A



where Area A Area B J(u, v ) .

Kenneth Harris (Math 425)

V = X.

 The transformation (xy uv ) is given by

(u,v )B

fU,V (u, v ) =

U = XY

11 / 32

Kenneth Harris (Math 425)

Example

Math 425 Intro to Probability Lecture 30

April 3, 2009

13 / 32

Examples: Polar Coordinates

Functions of a Random Variable: Density

Rectangle to Polar coordinates

 So, the joint density is

polarIt iscoordinates
often convenient to change from rectangular coordinates xy to
r . The transformation (xy r ) is



fU,V (u, v ) = fX ,Y h1 (u, v ), h2 (u, v ) J(u, v )
u 1
= fX ,Y v ,

v
|v |

 We can compute the marginal f (u) = f


U

fXY (u) =

fX ,Y v ,

XY (u)

r = x2 + y2

where r > 0 and

= arctan

y
.
x

< .


The inverse transformation (r xy ) from polar back to
rectangular is

by

x = r cos

u 1

dv
v
|v |

y = r sin .

 The transformation is (xy r ) nice in the punctured plane


R2 {(0, 0)}. Verified in three slides.

Kenneth Harris (Math 425)

Math 425 Intro to Probability Lecture 30

April 3, 2009

14 / 32

Kenneth Harris (Math 425)

Math 425 Intro to Probability Lecture 30

April 3, 2009

16 / 32

Examples: Polar Coordinates

Examples: Polar Coordinates

Converting Rectangle to Polar

 Rectangle xyp-coordinates to polar r -coordinates:


y
r = x 2 + y 2, r > 0
= arctan ,
x
Polar r -coordinates to rectangle xy -coordinates
x = r cos

Converting Rectangle to Polar

 Plot of tan

on [, ]. The four quadrants of the plane are

I : x, y > 0

< ,

< x, y < .

y = r sin

y
x

II : x < 0, y > 0

II

III : x, y < 0

III

IV : x > 0, y < 0

IV

Hx,yL=Hr,L

4
2
r=

x2 + y2

-2

y=rsin

-2
-4

=arctan

-6

y
x
x=rcos

Kenneth Harris (Math 425)

Math 425 Intro to Probability Lecture 30

April 3, 2009

17 / 32

Kenneth Harris (Math 425)

Examples: Polar Coordinates

Math 425 Intro to Probability Lecture 30

April 3, 2009

Examples: Polar Coordinates

Problem: Rectangle to Polar

Example

Problem. Let (X , Y ) be randomly chosen in some region R of the


xy -plane with joint density fX ,Y (x, y ).
Consider the random variables giving the polar coordinates

Example. Let (X , Y ) be uniformly distributed in R = unit circle. So,

R=

X2 + Y2

= arctan

fX ,Y (x, y ) =

when x 2 + y 2 1.

fR, (r , ) = r fX ,Y (r cos , r sin ) =

0 < r 1, <

 The marginals are


sin
= r cos2 + r sin2 = r
r cos

 The joint distribution of R, is


fR, (r , ) = r fX ,Y (r cos , r sin )

 So,

Y
X

where R > 0 and < .


The Jacobian is easiest to compute on the r -plane:

cos
J(r , ) =
r sin

18 / 32

fR (r )

Z 1

f ()

r > 0, < .

=
0

r
d = 2r

0 < r 1,

r
1
dr =

< .

Thus, is uniformly distributed on (, ].


Kenneth Harris (Math 425)

Math 425 Intro to Probability Lecture 30

April 3, 2009

19 / 32

Kenneth Harris (Math 425)

Math 425 Intro to Probability Lecture 30

April 3, 2009

20 / 32

Examples: Polar Coordinates

Examples: Polar Coordinates

Example

Example

Example. Let (X , Y ) be independent and normally distributed in the


plane with ( = 0, 2 ). So,

Example. Let R be exponentially distributed with mean 2 and be


uniformly distributed in (, ], both independent. The joint distribution
is

fX ,Y (x, y ) =

 Since f

R, (r , )

2
2
2
1
e(x +y )/2
2
2

fR, (r , ) =

 The marginals areZ

2
2
r
fR (r ) =
er /2 d =
2
2

Z
2
2
r
f () =
er /2 dr =
2
2
0

0 < r , < .

Math 425 Intro to Probability Lecture 30

April 3, 2009

Y = R sin

Solve for r , in the transformation x = 2r cos and y = 2r sin :


X =

cos

J(r , ) = 2 r
r sin
21 / 32

y
.
x

Kenneth Harris (Math 425)


cos2 sin2
1
=

+
= .

2
2
2
r cos
sin

2 r

Math 425 Intro to Probability Lecture 30

April 3, 2009

22 / 32

April 3, 2009

24 / 32

Examples: Polar Coordinates

Example continued

 So,

= arctan

The Jacobian determinant is easiest to compute using r -coordinates:

Examples: Polar Coordinates

fR, (r , ) =

R cos

r = x2 + y2

r r 2 /22
e
0 < r,
2
1
< .
2

Thus, is uniformly distributed on (, ] and R is the Rayleigh


distribution (the distance of (X , Y ) from the origin).
Kenneth Harris (Math 425)

0 < r , <

 Let X and Y be random variables determined by

= r fX ,Y (r cos , r sin ),

2
2
2
2
2
2
2
r
r
e(r cos +r sin )/2 =
er /2
fR, (r , ) =
2
2
2
2

1 1 r /2
e
2 2

Examplecontinued

1 1 r /2
e
2 2

Let U and V be uniformly distributed on (0, 1).

 Consider the random variable :

0 < r , <

= 2V
fX ,Y (x, y )

=
=

y
fR, (x 2 + y 2 , arctan ) 2
x
1 (x 2 +y 2 )/2
e
2

So, is uniformly distributed on (, ).

 Consider the random variable R:

X and Y are independent and normally distributed random


variables with ( = 0, 2 = 1). The marginals are obtained by
integrating fX ,Y (x, y ):

Kenneth Harris (Math 425)

fX (x)

fY (y )

R = 2 ln

solving, u = er /2 .

By Proposition 5.7.1 (Ross, page 243),

2
1
ex /2
2
2
1
ey /2
2

Math 425 Intro to Probability Lecture 30

1
U

1
fR (r ) = fU (er /2 ) u 0 = er /2
2

So, R is exponentially distributed with mean 2.


April 3, 2009

23 / 32

Kenneth Harris (Math 425)

Math 425 Intro to Probability Lecture 30

Examples: Polar Coordinates

Examples: Polar Coordinates

Example continued

Converting Rectangle to Polar

 Let X and Y be random variables determined by

 Simulating a standard normal random variable with a pair of independent

X =

uniform random variables on (0, 1).

R cos

Y =

R sin

Then X and Y are independent standard normal random variables!!

 We can simulate a standard normal random variable X by using two

independent uniform random variables U and V on (0, 1):


r

1
X = 2 ln cos 2V .
U

Kenneth Harris (Math 425)

Math 425 Intro to Probability Lecture 30

April 3, 2009

25 / 32

1000 data points


0.5
0.4
0.3
0.2
0.1
0.0
-3 -2 -1 0

Kenneth Harris (Math 425)

Example of Joint Distribution

10,000 data points

0.5
0.4
0.3
0.2
0.1
0.0
-3 -2 -1 0

Math 425 Intro to Probability Lecture 30

April 3, 2009

26 / 32

Example of Joint Distribution

Example

Example continued

 The transformation into uv -coordinates

Example. Let X and Y be independent and uniformly distributed on


(0, 1]. Find the joint probability density function for the random
variables
U=

X
Y

u=

fX (x) =

1
0

if 0 x 1
otherwise

(
1
fY (y ) =
0

x=

Kenneth Harris (Math 425)

 So, u, v > 0 and

if 0 x, y 1
otherwise.

Math 425 Intro to Probability Lecture 30

fU,V (u, v ) = fX ,Y

April 3, 2009

r
uv

y=

v
.
u

The Jacobian determinant is easiest when computed in xy


coordinates:

if 0 y 1
otherwise

So, the joint distribution fX ,Y (x, y ) is


(
1
fX ,Y (x, y ) = fX (x) fY (y ) =
0

v = xy ,

is one-to-one and has an inverse

V = XY .

 Individually, the distribution of X and Y are


(

x
y

28 / 32

Kenneth Harris (Math 425)

1
J(x, y ) = y
y

r
uv ,

x
yx2
= 2 = 2u

y
x

v  1

=
u
2u

1
2u

if 0 <

otherwise.

Math 425 Intro to Probability Lecture 30

uv ,

v
u

April 3, 2009

29 / 32

Example of Joint Distribution

Example of Joint Distribution

Example continued

Example continued

 It remains to compute the bounds on u and v .


0<

r
uv ,

fU,V (u, v ) =

v
1
1 = 0 < v , 0 < v u.
u
u

 We compute the marginals.

Only one of these ranges need be retained, depending upon whether


u (0, 1] or u [1, ):
fU (u) =
fU,V (u, v ) =

2u

if 0 < u < 1, 0 < v u,


or, if u 1, 0 < v u1 ,
otherwise.

April 3, 2009

30 / 32

Example of Joint Distribution

Example continued

 Plot of area determined by

and

u 1 = 0 < v

1
.
u

v
1.0

0.8

0.6
1
v

0.4

0.2

1
Kenneth Harris (Math 425)

Math 425 Intro to Probability Lecture 30

1
2u dv
u 1
dv
0 2u

(R

Math 425 Intro to Probability Lecture 30

0 < u < 1 = 0 < v u

R u

R01

fv (v )

Kenneth Harris (Math 425)

2u

u
April 3, 2009

32 / 32

Kenneth Harris (Math 425)

1
v

1
2u

du

if 0 < u < 1, 0 < v u,


or, if u 1, 0 < v u1 ,
otherwise.

if 0 < u < 1
if u 1
otherwise

2 dv
= 2u1 2 dv

if 0 < v 1
=
otherwise

ln v1
0

Math 425 Intro to Probability Lecture 30

if 0 < u < 1
if u 1
otherwise

if 0 < v 1
otherwise

April 3, 2009

31 / 32

Você também pode gostar