lecture 8 - pkumwfy.gsm.pku.edu.cn/miao_files/probstat/lecture8.pdf · 4 example!suppose xhas a...
TRANSCRIPT
1
Lecture 8
! Functions of a Random Variable
! Functions of Two or More Random Variables.
2
Functions of A Random Variable
! Suppose X has a discrete distribution withp.f. f, and Y=r(X), a function of X. The p.f. ofY is:
å=
=
====
yxrxxfyXryYyg
)(:)())(Pr()Pr()(
3
Variable with A Continuous Distribution! Suppose X has a continuous distribution with p.d.f. f,
and Y=r(X), a function of X. The d.f. G of Y can bederived as:
If Y also has a continuous distribution, its p.d.f. g canbe obtained by
at any y where G is differentiable.
ò £=
£=£=
})(:{)(
))(Pr()Pr()(
yxrxdxxf
yXryYyG
dyydGyg )()( =
4
Example! Suppose X has a uniform distribution on (-1,1),
What is the p.d.f for ?
îíì <<-
=otherwise
xforxf
0,112/1
)(
2XY =
5
Solution
1/2
1/2
2
1/2 1/2
1/2
1/2
1/2
1/2
For 0 1,( ) Pr( ) Pr( )Pr( )
12
0, 0So ( ) , 0 1
1, 1
For 0 1,( ) 1( )
21 , 0 1
2So ( )0, otherwise
y
y
yG y Y y X y
y X y
dx y
yG y y y
y
ydG yg ydy y
yyg y
-
£ <
= £ = £
= - £ £
= =
<ìï= £ <íï ³î
< <
= =
ì < <ï= íïî
ò
6
Direct Derivation of p.d.f.! Suppose Y=r(X) where r is continuous, and X lies in a
certain interval (a,b) over which the function r(x) isstrictly increasing.• Then r is a one-to-one function which maps (a,b) to (a,b) . Ithas an inverse function X=s(Y).
• For any y such that a<y<b,
• Suppose s is differentiable over (a,b), then)]([))(Pr())(Pr()Pr()(
ysFysXyXryYyG
=£=£=£=
dyydsysf
dyysdF
dyydGyg
)()]([
))(()()(
=
==
7
! Suppose Y=r(X) where r is continuous, and X lies in acertain interval (a,b) over which the function r(x) isstrictly decreasing.• Then r is a one-to-one function which maps (a,b) to (a,b) . Ithas an inverse function X=s(Y).
• For any y such that a<y<b,
• Suppose s is differentiable over (a,b), then)]([1))(Pr())(Pr()Pr()(ysFysXyXryYyG
-=³=£=£=
dyydsysf
dyysdF
dyydGyg
)()]([
))(()()(
-=
-==
8
Theorem. Let X be a random variable for which thep.d.f. is f and Pr(a<X<b)=1. Let Y=r(X), and supposethat r(x) is continuous and either strictly increasing orstrictly decreasing for a<x<b. Suppose also that r(x)maps a<x<b to a<y<b, and let X=s(Y) be the inversefunction for a <Y<b. Then the p.d.f. of Y is specifiedby
ïî
ïíì
<<=otherwise
yfordyydsysfyg
0
,)()]([)( ba
9
Example! Suppose X has a p.d.f.
What is the p.d.f. of ?îíì <<
=otherwise
xforxxf
0,103
)(2
21 XY -=
10
Solution (1)2
2
2
1 2
1
3/ 2
3/ 2
1 , 0<X<1
For 0 1,( ) Pr( )
Pr[1 ] Pr[1 ]
= Pr[ 1 ]
= 3
1- (1- ) 0, 0
So ( ) 1- (1- ) , 0 11, 1
y
Y X
yG y Y y
X yX y
X y
x dx
yy
G y y yy
-
= -
< <= £
= - £
= - £
³ -
=
£ìï= < <íï ³î
ò
1/ 23 (1 ) , 0 1( )( ) 20, otherwise
y ydG yg ydy
ì - < <ï= = íïî
11
Solution (2)! Y is a continuous, strictly decreasing function for
0<X<1, with range 0<Y<1. The inverse function isfor 0<Y<1.2/1)1()( YYsX -==
1/ 2
1/ 21/ 2
( ) 12(1 )
1 33(1 ) (1 ) , 0 12(1 ) 2( )
0, otherwise
ds ydy y
y y yyg y
= --
ì - = - < <ï -= íïî
12
Functions of Two or More Random Variables
! Suppose X1,...,Xn have a discrete joint distribution withp.f. f, and m functions Y1,...,Ym of these n randomvariables are:
• For any given values y1,...,ym, let A denote the set ofall points (x1,...,xn) such that
• Then the joint p.f. g of Y1,...,Ym is:
1 1 1
1
( , , )
( , , )
n
m m n
Y r X X
Y r X X
=
=
LM M
L
1 1 1
1
( , , )
( , , )
n
m n m
r x x y
r x x y
=
=
LM ML
1
1 1( , , )
( , , ) ( , , )n
m nx x A
g y y f x xÎ
= åL
L L
13
Variables with A Continuous Joint Distribution
! Suppose the joint p.d.f. of X1,...,Xn is f(x1,...,xn) andY=r(X1,...,Xn). For any given value y, let Ay be thesubset of containing all points (x1,...,xn) such that
. Then
If the distribution of Y is also continuous, then thep.d.f. of Y can be found by differentiating the d.f.G(y).
nR
1( , , )nr x x y£L
1
1 1
( ) Pr( ) Pr[ ( , , ) ]
( , , )y
n
n nA
G y Y y r x x y
f x x dx dx
= £ = £
= ò òL
L L L
14
The Distribution of Maximum and Minimum Values in a Random Sample
! Suppose X1,...,Xn form a random sample ofsize n from a distribution with p.d.f. f and d.f.F. Consider
! (1) d.f. and p.d.f of ?
1max( , , )n nY X X= L
1max( , , )n nY X X= L
15
Solution! X1,...,Xn form a random sample of size n from
a distribution with p.d.f. f and d.f. F.
[ ]
[ ]
1
1
1
1
max( , , )
( ) Pr( ) Pr( , , )Pr( ) Pr( )
( ) ( ) ( ) , for -
( )( ) ( ) ( ), for -
n n
n n n
nn
nnn
Y X X
G y Y y X y X yX y X y
F y F y F y y
dG yg y n F y f y ydy
-
=
= £ = £ £
= £ £
= = ¥ < < ¥
= = ¥ < < ¥
L
LL
L
16
1 1min( , , )nY X X= L! (2) d.f. and p.d.f of ?
17
! Solution:
[ ] [ ][ ]
[ ]
1 1
1 1 1
1
1
111
min( , , )
( ) Pr( ) 1 Pr( )1 Pr( , , )1 Pr( ) Pr( )1 1 ( ) 1 ( )
1 1 ( ) , for -
( )( ) 1 ( ) ( ), for -
n
n
n
n
n
Y X X
G y Y y Y yX y X yX y X yF y F y
F y y
dG yg y n F y f y ydy
-
=
= £ = - >= - > >= - > >
= - - -
= - - ¥ < < ¥
= = - ¥ < < ¥
L
LLL
18
1 1min( , , )nY X X= L! (3) Joint d.f. and joint p.d.f of and ? 1max( , , )n nY X X= L
19
! Suppose we want to find the joint distribution of and 1 1min( , , )nY X X= L 1max( , , )n nY X X= L
[ ][ ] [ ]
1
1 1 1
1 1
1 1 1
11
1
1
21
11
For - ,( , ) Pr( )Pr( ) Pr( )Pr( ) Pr( , , )
( ) Pr( )
( ) ( ) ( )
( ) ( ) ( )
( , )( , )
n
n n n
n n n n
n n n n nn
n n i ni
nn n n
n nn n
nn
n
y yG y y Y y and Y y
Y y Y y and Y yY y y X y y X y
G y y X y
G y F y F y
F y F y F y
G y yg y yy y
=
¥ < < < ¥
= £ £ =
= £ - £ >
= £ - < £ < £
= - < £
= - -
= - -
¶=
¶ ¶
Õ
L
[ ] 21 1 1( 1) ( ) ( ) ( ) ( ), -
0, otherwise
nn n nn n F y F y f y f y y y-ì - - ¥ < < < ¥ï= í
ïî
20
Transformation of A Multivariate p.d.f.! Suppose X1,...,Xn have a continuous joint
distribution with joint p.d.f. f, and n newrandom variables Y1,...,Yn are defined by:
Suppose is the support for X1,...,Xn, theimage under the transformation is T. Assumethat the transformation from S to T is a one-to-one transformation.
1 1 1
1
( , , )
( , , )
n
n n n
Y r X X
Y r X X
=
=
LM M
L
nRS Ì
21
! We can get the inverse of the transformation:
! Suppose each partial derivative exists atevery point . The Jacobian of thetransformation can be constructed:
! The joint p.d.f. g of Y1,...,Yn can be derived:
1 1 1
1
( , , )
( , , )
n
n n n
X s Y Y
X s Y Y
=
=
LM M
L
ji ys ¶¶ /
1( , , )ny y TÎL
1 1
1
1
detn
n n
n
s sy y
Js sy y
¶ ¶é ùê ú¶ ¶ê ú
= ê úê ú¶ ¶ê úê ú¶ ¶ë û
L
M M
L
1 1 1 11
[ ( , , ), , ( , , )] | | ( , , )( , , )
0n n n n
n
f s y y s y y J for y y Tg y y
otherwiseÎì
= íî
L L L LL
22
Example
! Suppose X1 and X2 have a continuous jointdistribution with p.d.f.
What is the joint p.d.f. of Y1 and Y2?
îíì <<<<
=otherwise
xandxforxxxxf
010 104
),( 212121
, and Let 2122
11 XXYXXY ==
23
• The inverse of the transformation is
• S={(x1,x2): 0<x1<1, 0<x2<1}T={(y1,y2): y1>0, 0<y2<1, 0<y1y2<1, y2/y1<1}
• We have
1
22122212111 ),(),(
YYYYsXYYYYsX ====
212
231
2
1
2
2
1
2
1
1
2
1
1
121
21
21
21
yyys
yy
ys
yy
ys
yy
ys
=¶¶
-=¶¶
=¶¶
=¶¶
24
! The Jacobian is
! The p.d.f. of Y1 and Y2 is:1
1
2131
2
2
1
1
2
21||
21
121
21
21
21
det
yJ
yyyy
y
yy
yy
J
=
=
úúúúú
û
ù
êêêêê
ë
é
-
=
ïî
ïíì Î=
=otherwise
TyyforyyJyysyysfyyg
0
),(2||)],(),,([),( 211
2212211
21
25
The Sum of Two Random Variables! Suppose that X1 and X2 are i.i.d. random
variables and the p.d.f. for each is:
What is the p.d.f. g of Y=X1+X2?îíì >
=-
otherwisexfore
xfx
00
)(
26
Solution (1)
1
1
11 2
1
1 2
1 2 2 10 0
1 2 2 10 0
( )2 10 0
10
For 0,( ) Pr( )
Pr[ ]
( , )
= ( ) ( )
=
= ( )
1-0,
So ( )
y y x
y y x
y y x x x
y xy
y y
yG y Y y
X X y
f x x dx dx
f x f x dx dx
e dx dx
e e dx
e yey
G y
-
-
- - +
--
- -
>= £= + £
=
- +
= -
=
ò òò òò òò
01- , 0y ye ye y- -
£ìí
- >î
, 0( )( )0, otherwise
yye ydG yg ydy
-ì >= = í
î
27
Solution (2)! X1 and X2 have a given joint p.d.f. f, and we
want to find the p.d.f for Y=X1+X2.• Let Z=X2, then the transformation from X1 and X2 to
Y and Z will be a one-to-one linear transformation.
• The inverse of the transformation is
• S={(x1,x2): x1>0, x2>0}T={(y,z): y>0, 0<z<y}
• We have
X1=Y-Z, X2=Z
11011
det =÷÷ø
öççè
æ -=J
28
• The joint p.d.f. of Y and Z is:
• The marginal p.d.f. g of Y can be obtained by:
)()(),(),(0 zfzyfzzyfzyg -=-=
( )
0
0
For 0, ( ) ( ) ( )
, 0So
0, otherwise
y y z z
y y y
y
y g y f y z f z dz
e e dz
e dz ye
ye yg(y)
¥
-¥
- - -
- -
-
> = -
=
= =
ì >= íî
òòò
29
The Range! Suppose X1,...,Xn form a random sample of size n
from a distribution with p.d.f. f and d.f. F.and .W=Yn-Y1 is called the range of the sample. What isthe p.d.f. of W?
Solution: We already derived the joint p.d.f.g(y1,yn) of Y1 and Yn. If we let Z=Y1,then the transformation from Y1 and Yn
to W and Z will be a one-to-one lineartransformation.
),,min( 11 nXXY != ),,max( 1 nn XXY !=
30
• The inverse of the transformation is
• S={(y1,yn): -∞<y1<yn< ∞}T={(w,z): w>0, -∞< z < ∞}
• We have |J|=1.
• The marginal p.d.f of W is
Y1=Z, Yn=W+Z
[ ] 2
( , ) ( , )
( 1) ( ) ( ) ( ) ( ), ( , )0, otherwise
n
h w z g z w z
n n F w z F z f z f w z w z T-
= +
ì - + - + Îï= íïî
ò¥
¥-= dzzwhwh ),()(1
31
Example! Suppose that n variables X1,…,Xn form a random
sample from a uniform distribution on the interval(0,1). What is the p.d.f. of the range of the sample?
! Solution:
F(x)=x for 0<x<1.
îíì <<
=otherwise
xforxf
0101
)(
32
• The inverse of the transformation is
• S={(y1,yn): 0<y1<yn<1}T={(w,z): 0<w<1, 0< z <1-w}
• So
• The marginal p.d.f of W is
Y1=Z, Yn=W+Z
îíì -<<<<-
=-
otherwisewzwwnn
zwhn
010,10)1(
),(2
1 2 2
01
( 1) ( 1) (1 ) 0 1( )
0
w n nn n w dz n n w w for wh w
otherwise
- - -ì - = - - < <ï= íïî
ò