Transcription of 6 Jointly continuous random variables
1 6 Jointly continuous random variablesAgain, we deviate from the order in the book for this chapter, so the subsec-tions in this chapter do not correspond to those in the Joint density functionsRecall thatXis continuous if there is a functionf(x) (the density) such thatP(X t) =Zt fX(x)dxWe generalize this to two random random variablesXandYare Jointly continuous if thereis a functionfX,Y(x, y)onR2, called the joint probability density function,such thatP(X s, Y t) =Z Zx s,y tfX,Y(x, y)dxdyThe integral is over{(x, y) :x s, y t}. We can also write the integral asP(X s, Y t) =Zs Zt fX,Y(x, y)dy dx=Zt Zs fX,Y(x, y)dx dyIn order for a functionf(x, y) to be a joint density it must satisfyf(x, y) 0Z Z f(x, y)dxdy= 1 Just as with one random variable, the joint density functioncontains allthe information about the underlying probability measure if we only look atthe random variablesXandY. In particular, we can compute the probabilityof any event defined in terms ofXandYjust usingf(x, y).
2 Here are some events defined in terms ofXandY:{X Y},{X2+Y2 1}, and{1 X 4, Y 0}. They can all be writtenin the form{(X, Y) A}for some R2,P((X, Y) A) =Z ZAf(x, y)dxdyThe two-dimensional integral is over the subsetAofR2. Typically, whenwe want to actually compute this integral we have to write it as an iteratedintegral. It is a good idea to draw a picture ofAto help do rigorous proof of this theorem is beyond the scope of this course. Inparticular we should note that there are issues involving -fields and con-straints onA. Nonetheless, it is worth looking at how the proof might startto get some practice manipulating integrals of joint ( , s] ( , t], then the equation is the definition of jointlycontinuous. Now supposeA= ( , s] (a, b]. The we can write it asA= [( , s] ( , b]]\[( , s] ( , a]] So we can write the event{(X, Y) A}={(X, Y) ( , s] ( , b]}\{(X, Y) ( , s] ( , a]}MORE !!!!!!!!!Definition:LetA R2. We sayXandYare uniformly distributed onAiff(x) = 1c,if (x, y) A0,otherwisewherecis the area :LetX, Ybe uniform on [0,1] [0,2].))))))))))))
3 FindP(X+Y 1).Example:LetX, Yhave densityf(x, y) =12 exp( 12(x2+y2))ComputeP(X Y) andP(X2+Y2 1).Example:Now supposeX, Yhave densityf(x, y) = e x yifx, y 00,otherwise2 ComputeP(X+Y t).What does the pdf mean? In the case of a single discrete RV, the pmfhas a very concrete (x) is the probability thatX=x. IfXis asingle continuous random variable, thenP(x X x+ ) =Zx+ xf(u)du f(x)IfX, Yare Jointly continuous , thanP(x X x+ , y Y y+ ) 2f(x, y) Independence and marginal distributionsSuppose we know the joint densityfX,Y(x, y) ofXandY. How do we findtheir individual densitiesfX(x),fY(y). These are calledmarginal cdf ofXisFX(x) =P(X x) =P( < X x, < Y < )=Zx Z fX,Y(u, y)dy duDifferentiate this with respect toxand we getfX(x) =Z fX,Y(x, y)dyIn words, we get the marginal density ofXby integratingyfrom to in the joint Jointly continuous with joint densityfX,Y(x, y),then the marginal densities are given byfX(x) =Z fX,Y(x, y)dyfY(y) =Z fX,Y(x, y)dx3We will define independence of two contiunous random variables differ-ently than the book.
4 The two definitions are , Ybe Jointly continuous random variables with jointdensityfX,Y(x, y)and marginal densitiesfX(x),fY(y). We say they areindependent iffX,Y(x, y) =fX(x)fY(y)If we know the joint density ofXandY, then we can use the definitionto see if they are independent. But the definition is often used in a differentway. If we know the marginal densities ofXandYandwe know that theyare independent, then we can use the definition to find their joint :IfXandYare independent random variables and each has thestandard normal distribution, what is their joint density?f(x, y) =12 exp( 12(x2+y2))Example:Suppose thatXandYhave a joint density that is uniform onthe disc centered at the origin with radius 1. Are they independent?Example:IfXandYhave a joint density that is uniform on the square[a, b] [c, d], then they are :Suppose thatXandYhave joint densityf(x, y) = e x yifx, y 00,otherwiseAreXandYindependent?Example: Suppose thatXandYare uniform on [0,1]andYhas the Cauchy density.
5 (a) Find their joint density.(b) ComputeP(0 X 1/2,0 Y 1)(c) ComputeP(Y X). Expected valueIfXandYare Jointly continuously random variables , then the mean ofXis still given byE[X] =Z x fX(x)dxIf we write the marginalfX(x) in terms of the joint density, then this becomesE[X] =Z Z x fX,Y(x, y)dxdyNow suppose we have a functiong(x, y) fromR2toR. Then we can definea new random variable byZ=g(X, Y). In a later section we will see how tocompute the density ofZfrom the joint density ofXandY. We could thencompute the mean ofZusing the density ofZ. Just as in the discrete casethere is a , Ybe Jointly continuous random variables with jointdensityf(x, y). Letg(x, y) :R2 R. Define a new random variable byZ=g(X, Y). ThenE[Z] =Z Z g(x, y)f(x, y)dxdyprovidedZ Z |g(x, y)|f(x, y)dxdy < An important special case is the followingCorollary Jointly continuous random variables anda, bare real numbers, thenE[aX+bY] =aE[X] +bE[Y]Example:XandYhave joint densityf(x, y) = x+yif 0 x 1,0 y 10,otherwiseLetZ=X+Y.
6 Find the mean and variance now consider independence and independent and Jointly continuous , thenE[XY] =E[X]E[Y] they are independent,fX,Y(x, y) =fX(x)fY(y). SoE[XY] =Z Zxy fX(x)fY(y)dxdy= Zx fX(x)dx Zy fY(y)dy =E[X]E[Y] Function of two random variablesSupposeXandYare Jointly continuous random variables . Letg(x, y) be afunction fromR2toR. We define a new random variable byZ=g(X, Y).Recall that we have already seen how to compute the expected value ofZ. Inthis section we will see how to compute the density ofZ. The general strategyis the same as when we considered functions of one random variable: we firstcompute the cumulative distribution :LetXandYbe independent random variables , each of which isuniformly distributed on [0,1]. LetZ=XY. First note that the range ofZis [0,1].FZ(z) =P(Z z) =Z ZA1dxdyWhereAis the regionA={(x, y) : 0 x 1,0 y 1, xy z}PICTUREFZ(z) =z+Z1z"Zz/x01dy#dx=z+Z1z"Zz/x01dy#dx6=z+ Z1zzxdx=z+zlnx|1z=z zlnzThis is the cdf ofZ.
7 So we differentiate to get the (z) =ddzz zlnz= 1 lnz z1z= lnzfZ(z) = lnz,if 0 z 10,otherwiseExample:LetXandYbe independent random variables , each of which isexponential with parameter . LetZ=X+Y. Find the density get gamma with same andw= is special case of a much more general result. The sum of gamma( , w1)and gamma( , w2) is gamma( , w1+w2). We could try to show this as wedid the previous example. But it is much easier to use moment generatingfunctions which we will introduce in the next :Let (X, Y) be uniformly distributed on the triangle with verticesat (0,0),(1,0),(0,1). LetZ=X+Y. Find the pdf of the most important examples of a function of two randomvariablesisZ=X+Y. In this caseFZ(z) =P(Z z) =P(X+Y z)=Z Zz x f(x, y)dy dxTo get the density ofZwe need to differentiate this with respect toZ. Theonlyzdependence is in the upper limit of the inside (z) =ddzFZ(z) =Z ddzZz x f(x, y)dy dx=Z f(x, z x)dx7 IfXandYare independent, then this becomesfZ(z) =Z fX(x)fY(z x)dxThis is known as a convolution.
8 We can use this formula to find the density ofthe sum of two independent random variables . But in some cases it is easierto do this using generating functions which we study in the next :LetXandYbe independent random variables each of which hasthe standard normal distribution. Find the density ofZ=X+ need to compute the convolutionfZ(z) =12 Z exp( 12x2 12(z x)2)dx=12 Z exp( x2 12z2+xz)dx=12 Z exp( (x z/2)2 14z2)dx=e z2/412 Z exp( (x z/2)2)dxNow the substitutionu=x z/2 showsZ exp( (x z/2)2)dx=Z exp( u2)duThis is a constant - it does not depend onz. SofZ(z) =ce z2/4. Anothersimple substitution allows one to evaluate the constant, but there is no can already see thatZhas a normal distribution with mean zero andvariance 2. The constant is whatever is needed to normalize the Moment generating functionsThis will be very similar to what we did in the discrete a continuous random variableX, the moment generatingfunction (mgf) ofXisMX(t) =E[etX] =Z etxfX(x)dx8 Example:Compute it for the gamma distribution and findM(t) = t wA special case of the gamma distribution is the exponential distribution -you just takew= 1.
9 So we see that for the exponentialM(t) = 3.(1) LetXbe a continuous random variable with mgfMX(t).ThenE[Xk] =dkdtkMX(t)|t=0(2) IfXandYare independent continuous random variables thenMX+Y(t) =MX(t)MY(t)(3) If the mgf ofXisMX(t)and we letY=aX+b, thenMY(t) =etbMX(at) (1)dkdtkMX(t)|t=0=dkdtkZ fX(x)etx|t=0dx=Z fX(x)dkdtketx|t=0dx=Z fX(x)xketx|t=0dx=Z fX(x)xkdx=E[Xk]IfXandYare independent, thenMX+Y(t) =E[exp(t(X+Y))] =E[exp(tX) exp(tY)]=E[exp(tX)]E[exp(tY)] =MX(t)MY(t)This calculation assumes that sinceXandYare independent, then exp(tX)and exp(tY) are independent random variables . We have not shown (3) is justMY(t) =E[etY] =E[et(aX+b)] =etbE[etaX] =etbMX(at)9As an application of part (3) we haveExample:LetXhave the exponential distribution with parameter . LetY=X/ . Use mgf s to showYhas the exponential distribution with pa-rameter :In the homework you show that the mgf for the normal densityisMX(t) = exp( t)MZ( t) = exp( t+12 2t2)Proposition 4.
10 (a) IfX1, X2, , Xnare independent and each is normalwith mean iand variance 2i, thenY=X1+X2+ +Xnhas a normaldistribution with mean and variance 2given by =nXi=1 i, 2=nXi=1 2i(b) IfX1, X2, , Xnare independent and each is exponential with parameter , thenY=X1+X2+ +Xnhas a gamma distribution with parameters = andw=n.(c) IfX1, X2, , Xnare independent and each is gamma with parameters , wi, thenY=X1+X2+ +Xnhas a gamma distibution with parameters andw=w1+ + will prove the theorem by proving statements about generating func-tions. For example, for part (a) what we will really prove is that the momentgenerating function ofYis that of a normal with the stated complete the proof we need to know that if two random variables havethe same moment generating functions then they have the is a theorem but it is a hard theorem and it requires some technicalassumptions on the random variables . We will ignore these subtleties andjust assume that if two RV s have the same mgf, then they have the prove all three parts by simply computing the mgf s Cumulative distribution functions and more inde-pendenceRecall that for a discrete random variableXwe have a probability massfunctionfX(x) which is justfX(x) =P(X=x).