Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Function of Random Variables 7.1 Introduction How to find the distribution of a random variable Y that is a function of several random variables X1, X2, âŚ, Xn that has a joint probability distribution? Functions of Random Variables đŚ = đ˘(đĽ1 , đĽ2 , âŚ, đĽđ ) Methods for finding distribution of function of one or more random variables: 1. Distribution Function Technique 2. Transformation Technique 3. Moment Generating Function Technique 1 7.2 Distribution Function Technique Example: Let X ~ U(0,1), and Y = đ đ , find đ. đ. đ. of đ. For finding the probability density function with a given joint probability density, the probability density function of đ = đ˘(đ1 , đ2 , âŚ, đđ ) can be obtained by first finding the cumulative probability or distribution function G(y) = P(Y ⤠y) = P(đ đ ⤠y) = P(X ⤠y1/n ) F(y)= đ đ ⤠y = đ(đ˘(đ1 , đ2 , âŚ, đđ ) = F(y1/n ) and then differentiate it to get the p.d.f. đ đŚ = = y1/n đđš(đŚ) đđŚ g đŚ = Example: Let X has the following p.d.f., 6đĽ 1 â đĽ , 0<đĽ<1 đ đĽ = 0, elswhere 4 Example: Let X have a p.d.f. f(x) and Y = đ 2 , find đ. đ. đ. of đ. G(y) = P(Y ⤠y) find the p.d.f. of Y = đ 3 . = P(đ 2 ⤠y) G(y) = P(Y ⤠y) = P(đ 3 ⤠y) = P(-y1/2 ⤠X ⤠y1/2) = P(X ⤠y1/3 ) y1/3 = 0 6đĽ 1 â đĽ đđĽ = F(y1/2) - F(- y1/2) = 3y2/3 â 2y, for 0< y <1 â1/3 â 1), 0 < đŚ < 1 g đŚ = 2(y 0, elswhere. 1 1 â1 đŚđ , 0 ⤠đŚ â¤ 1 đ 0, elswhere. g(y) = 2 5 1 đŚ đ(y1/2) + f(â y1/2) 6 FRV - 1 Function of Random Variables G(y) = P(Y ⤠y) = P(|X|⤠y) = P(-y ⤠X ⤠y) G(y) = P(Y ⤠y) = P(lnX ⤠y) = P(X ⤠e y ) = F(y) - F(- y) g(y) = đ(y) + f(ây), for y > 0 = when đ ~ đ 0,1 , g(y) = 2đ(y) , for y > 0 =2 -y 0 y 1 2đ đâ 6đ â3đĽ1 â2đĽ2 , 0, đŚ 0 g(y) = Gâ˛(y) = 7 1 đŚ â1 âđ đŚ đ đ đ , đ -ďĽ < y < ďĽ 8 Example: If X1 and X2 are independent random variables having U(0,1), find the distribution function of Y = X1+X2. for đĽ1 > 0, đĽ2 > 0 elsewhere đ1 đĽ1 = 1 = đ2 đĽ2 ď đ đĽ1 , đĽ2 , for 0 < đĽ1 < 1, 0 < đĽ2 < 1. x1 F(y) = P(Y ⤠y) = P(X1 + X2 ⤠y) đŚ đŚâđĽ2 6đ â3đĽ1â2đĽ2 0 0 1 = 1 â đ âđâđ đŚ2 2 Find the probability of Y = X1 + X2 = đ đŚ 1 âđĽ đ đ đđĽ 0 đ đŚ đĽ đ âđ =-đ Example: If the joint density of X1 and X2 is given by đ đĽ1 , đĽ2 = đĽ 1 Example: Let X have a p.d.f. đ đĽ = đ đ âđ , for đĽ > 0, find p. d. f. of đ = ln đ . Example: Let X have a p.d.f. f(x) and Y = |X|, find đ. đ. đ. of đ when đ ~ đ 0,1 . x1 + x2 = y đđĽ1 đđĽ2 F(y) = 0, if y ⤠0. 1 = 1 + 2e-3y â 3e-2y 0 F(y) = 2 đŚ 2 , if 0 < y ⤠1. y F(y) = 1 â F(y) = f (y) = 6(e-2y â e-3y), for y > 0, f (y) = 0, elsewhere. (2âđŚ)2 , 2 if 1 < y ⤠2. 1 x2 0 1 y = x1 + x2 F(y) = 1, if y > 2. 9 7.3 Transformation Technique: One Variable For discrete random variable, whether X and Y = u(X) is one-to-one or not, finding the distribution of Y is straight forward substitution. Example: Let X be the number of heads in tossing a balanced coin three times, find the probability distribution of Y = 1/(1+X) . (One-to-one function) 10 Example: Let X be the number of heads in tossing a balanced coin three times, find the probability distribution of Y = (1 - X)2 . (Not one-to-one function) x f(x) 0 1/8 1 3/8 2 3/8 3 1/8 4 1/8 x f(x) 0 1/8 1 3/8 2 3/8 3 1/8 y* g(y*) 1 1/8 0 3/8 1 3/8 y g(y) 1 1/8 1/2 3/8 1/3 3/8 1/4 1/8 y g(y) 0 3/8 1 4/8 4 1/8 11 12 FRV - 2 Function of Random Variables Inverse Function Theorem : For functions of a single variable, if u is a continuously differentiable function with nonzero derivative at the point x, then u is invertible in a neighborhood of x, the inverse is continuously differentiable, and 1 đˇđŚ đ˘â1 (đŚ) = đˇđĽ đ˘(đĽ) where y = u(x). Theorem 7.1: (Univariate Transformation Theorem) Let f(x) be the probability density of the continuous random variable X at x. If the function given by y = u(x) is differentiable and either (monotone) increasing and decreasing for all values within the range of X that has density, then the equation y = u(x) is one-to-one and x = w(y), and the probability density of Y = u(X) is given by g đŚ = đ đ¤ đŚ â đ¤ ⲠđŚ , for đ˘â˛(đĽ) â 0 0, elsewhere. (đ˘â1 đŚ )Ⲡ= đ¤â˛(đŚ) = 13 đ˘â˛ 1 đđĽ = đĽ đđŚ 14 Example: X ~ U (0, 1) u(x) is increasing function Another version of the formula: u-1 (y) = w(y) f(x) y y = u(x) g đŚ = đ đ˘â1 đŚ â đ â1 đ˘ đđŚ 0, đŚ , for đ˘â˛(đĽ) â 0 x b elsewhere. 0 .5 1 a Y = 2X w(a) w(b) x g(y) P(u(X) ⤠y) = P(X ⤠w(y)) y 0 1 2 15 16 Example: X ~ U (0, 1) u(x) is decreasing function Let u(x) be a strictly decreasing function in the range of X, and w be the inverse function of u, i.e., u-1 . f(x) y b G(y) = P(Y ⤠y) = P(u(X) ⤠y) x y = u(x) 0 .5 1 Y = -2X a w(b) w(a) x g(y) P(u(X) ⤠y) = P(X ďł w(y)) -2 -1 y 0 17 = P(X ďł w(y)) = 1 - P(X < w(y)) =1 - F(w(y)) g(y) = G ď˘(y) = - F ď˘(w(y)) = -f(w(y))ďwâ˛(y) Since u(x) is a decreasing function then wâ˛(y) < 0. If u(x) is a increasing function in the range of X, then G(y) = P(Y ⤠y) = P(u(X) ⤠y) = P(X ⤠w(y)) = P(X < w(y)) = F(w(y)) g(y) = G ď˘(y) = F ď˘(w(y)) = f(w(y))ďwâ˛(y), with wâ˛(y) > 0. g đŚ = đ đ¤ đŚ â đ¤ ⲠđŚ , for đ˘â˛(đĽ) â 0 0, elsewhere. 18 FRV - 3 Function of Random Variables Example: Let X have the exponential distribution with p.d.f. f(x) given by đ âđĽ , for đĽ > 0, đ đĽ = 0, elsewhere find the p.d.f. of the random variable Y = đ. Sol: For y > 0, y = đĽ ď x = y2 . w(y) = y2 , wď˘(y) = 2y 2 g(y) = đ(đŚ 2 ) â 2đŚ = đ âđŚ |2đŚ| g đĽ = 2đŚđ 0, q a x = a ď tanq 0 x Example: Let X be the a random variable takes the distance for 0 to a point on the x-axis where the double arrow will point to, when it is spun. The random variable Q is the angle that has uniform density for y > 0 1 đ đ = đ, 0, âđŚ 2 , for đŚ > 0, (Weibull Distribution) elsewhere. đ đ <đ< , 2 2 elsewhere for â find the p.d.f. of the random variable X. 19 Example: If F(x) is the distribution function of the continuous random variable X, find the p.d.f. of Y = F(x). q a x = a ď tanq Sol: 20 0 x x = a ď tan q ď đđ đ = đđĽ đ2 + đĽ 2 Sol: Let y = F(x), dx 1 1 ď˝ ď˝ , for f ( x) ďš 0. dy dy f ( x) dx 1 đ â đ đ2 + đĽ 2 1 đ for -ďĽ < x < ďĽ. = â 2 đ đ + đĽ2 g(x) = g(y) = f(x) ď 21 Distribution Function Method for Random Numbers: 1. Generate a U(0, 1) random number 2. set this random numbers equal to F(x) and solve for x. 3. The value x would be a random number from the distribution that has a distribution function F(x). Example: Generate a random number from exponential distribution with parameter q using U(0,1) random number. F(x) = 1 â e-x/q = u u is a random # from U(0, 1) The random # from the exponential distribution would be: x = -q ďln (1 â u) dy ď˝ F ď˘( x) ď˝ f ( x) dx 23 1 = 1, for 0 < y <1. f ( x) * Distribution function technique for random number generation using U(0,1) random number generator. 22 Example: If X has the standard normal distribution find the probability density of Z = X 2. Sol: z = x 2 is not one-to-one. First let Y = |X|, then Z = Y 2 = X 2 2 â1đŚ 2 đ 2 for y > 0 p.d.f. of Y ď g(y)= 2ďn(y; 0, 1) = 2đ z = y2 , w(z) = y = đ§ p.d.f. of Z ď h(z)= g( đ§ ) |wď˘(y)| 2 â1đ§ 1 â1 1 â1 â1đ§ for z > 0 = đ 2 ď đ§ 2 = đ§ 2đ 2 2 2đ 2đ (Chi-square distribution with degrees of freedom = 1.) 24 FRV - 4 Function of Random Variables Example: Let X ~ U(0,1), and Y = đ đ , find đ. đ. đ. of đ. 7.4 Transformation Method: Several Variables For random variable Y = u(X1, X2) where the joint distribution or density of X1 and X2 is given, and one can find the joint distribution or density for Y and X2 or X1 and Y by holding the other variable fixed, if possible, and then find the marginal distribution or density function for Y. In continuous case, one can first use the transformation technique with the formula, by holding x1 or x2 fixed, g đŚ, đĽ2 = đ(đĽ1 , đĽ2 ) â Answer: g đŚ = 1 1 â1 đŚđ , 0 ⤠đŚ â¤ 1 đ 0, elswhere. or 25 Example: If X1 and X2 are independent random having Poisson distribution with the parameters l1 and l2 , find the probability distribution of the random variable Y = X 1 + X 2. Sol: Since X1 and X2 are independent, the joint density is đ âđ1 đ1 x1 đ âđ2 đ2 x2 đ â(đ1 +đ2 ) đ1 x1 đ2 x2 đ đĽ1 , đĽ2 = â = đĽ1 ! đĽ2 ! đĽ1 ! đĽ2 ! for x1 = 0, 1, 2, âŚ, and x2 = 0, 1, 2, ⌠. Since y = x1 + x2 then x1 = y - x2 đ â(đ1+đ2 ) đ1 đŚâx2 đ2 x2 Joint Distribution đ đŚ, đĽ2 = of Y and X2 (đŚ â đĽ2 )! x2! for y = 0, 1, 2, âŚ, and x2 = 0, 1, 2, âŚ, y . 27 Example: Let random variables X1 and X2 have the joint p.d.f. as đ đĽ1 , đĽ2 = đ â(đĽ1 +đĽ2 ) , 0, đđĽ g đĽ1 , đŚ = đ(đĽ1 , đĽ2 ) â 2 đđŚ then find the marginal density of Y. đŚ â(đŚ) = đĽ2 =0 = đ1 đ1 +đ2 Sol: Since y decreases as x2 increases and x1 hold constant, we can find a joint density of X1 and Y and then use transformation technique to find density of Y. đĽ1 1âđŚ đŚ= âš đĽ2 = đĽ1 â for 0 < y < 1 đĽ1 + đĽ2 đŚ đđĽ2 đĽ1 đĽ1 âš =â 2 đ đĽ1 , đŚ = đ âđĽ1 /đŚ â 2 29 đđŚ đŚ đŚ 26 đ â(đ1+đ2 ) đ1 đŚâx2 đ2 x2 (đŚ â đĽ2 )! x2! đ â(đ1 +đ2 ) = đŚ! đ â đ1 +đ2 đŚ đĽ2 =0 đŚ! đ đŚâx2 đ2 x2 (đŚ â đĽ2 )! x2! 1 (đ1 + đ2 )đŚ đŚ! for y = 0, 1, 2, ⌠. The sum of two independent Poisson random variables with parameters l1 and l2 is a Poisson random variable with parameter l1 + l2 . đ đĽ1 , đŚ = đ âđĽ1 /đŚ â for đĽ1 > 0, đĽ2 > 0, elsewhere find the p.d.f. of the random variable Y = đđĽ1 đđŚ = â 0 â = 0 = 1 đĽ1 đŚ2 đĽ1 âđĽ /đŚ đ 1 đŚ2 â đŚ = 28 for x1 > 0, 0 < y < 1. đĽ1 âđĽ /đŚ â đ 1 đđĽ1 đŚ2 Let u = x1 / y du = -1/y2 dx1 đ˘ â đ âđ˘ đđĽ1 for 0 < y < 1. It is a U(0, 1)!!! 30 FRV - 5 Function of Random Variables Example: Let random variables X and Y have the joint p.d.f. as 2, for đĽ > 0, đŚ > 0, đĽ + đŚ < 1 đ đĽ, đŚ = 0, elsewhere find the joint p.d.f. of X and Z = X + Y & marginal p.d.f. of Z. z = x + y ď y = z â x , and 0 < z â x and 0 < z < 1 đđŚ z z=x đ đĽ, đ§ = đ(đĽ, đŚ) 1 đđ§ = 2 â 1 = 2 for x < z, 0 < z < 1 đ§ đ§ x â đ§ = 2đđĽ = 2đĽ = 2đ§ 0 0 1 31 0 for 0 < z < 1 Example: Let random variables X1 and X2 have the joint p.d.f. as đ â(đĽ1 +đĽ2 ) , for đĽ1 > 0, đĽ2 > 0, đ đĽ1 , đĽ2 = 0, elsewhere đ1 . a) find the joint p.d.f. of Y1= X1 + X2 , and Y2 = đ1 +đ2 đĽ1 đŚ1 = đĽ1 + đĽ2 and đŚ2 = đĽ1 + đĽ2 âš đĽ1 = đŚ1 đŚ2 and đĽ2 = đŚ1 (1 â đŚ2 ) 0 < y1 and 0 < y2 <1 đđĽ1 đđŚ1 đ˝= đđĽ2 đđŚ1 đđĽ1 đŚ2 đđŚ2 = 1âđŚ đđĽ2 2 đđŚ2 đŚ1 âđŚ1 = âđŚ1 1, 0, Let f(x1, x2) be the joint probability density of the continuous random variable X1 and X2. If the function given by y1 = u1(x1, x2) and y2 = u2(x1, x2) are partially differentiable w.r.t. both x1 and x2 and are one-to-one for which f(x1, x2) â 0, â x1, x2 in the space of X1 and X2 , and the inverse functions x1 = w1(y1, y2) and x2 = w2(y1, y2) can be uniquely determined (by solving for x1 and x2), the joint p.d.f. of Y1 = u1(X1, X2) and Y2 = u2(X1, X2) is g đŚ1 , đŚ2 = đ[w1(y1, y2),w2(y1, y2)] â đ˝ where J is the Jacobian of the transformation, is the đđĽ1 đđĽ1 determinant đđŚ1 đđŚ2 đ˝= đđĽ2 đđĽ2 đđŚ1 đđŚ2 32 g đŚ1 , đŚ2 = đ âđŚ1 âđŚ1 = đŚ1 đ âđŚ1 for 0 < y1 and 0 < y2 <1, and 0 elsewhere. b) Find the marginal density of Y2 . â â đŚ2 = 0 đ đŚ1 , đŚ2 đđŚ1 â = 0 đŚ1 đ âđŚ1 đđŚ1 = ď(2) =1 for 0 < y2 <1, and 0 elsewhere. 33 Example: Let random variables X1 and X2 have the joint p.d.f. as đ đĽ1 , đĽ2 = Theorem 7.2: (Generalization of Theorem 7.1) for 0 < đĽ1 < 1,0 < đĽ2 < 1, elsewhere 34 đ đŚ, đ§ = 1 â 1 = 1, for z < y < z + 1, 0 < z < 1, and 0, else where. b) Find the marginal density of Y. z 1 a) find the joint p.d.f. of Y = X1 + X2 , and Z = X2 . y = z + x1 , z = x2 y = x1 + x2 , and z = x2 ď x1= y - x2 , and x2 = z, z < y < z + 1, 0 < z < 1 đđĽ1 đđŚ đ˝= đđĽ2 đđŚ z đđĽ1 1 đđ§ 1 â1 = =1 đđĽ2 0 1 đđ§ 0, đŚ 1đđ§ = đŚ, â đŚ = đŚâ¤0 0 1 2 y for 0 < đŚ < 1 0 1 1đđ§ = 2 â đŚ, for 1 < đŚ < 2 đŚâ1 y 0 1 2 0, 35 đŚâĽ2 36 FRV - 6 Function of Random Variables Example: Let random variables X1 and X2 have the joint p.d.f. as b) find the marginal p.d.f. of Z = X + Y . 2, for đĽ > 0, đŚ > 0, đĽ + đŚ < 1, 0, elsewhere a) find the joint p.d.f. of Z = X + Y , and W = X - Y. đ đĽ, đŚ = z = x + y and w = x - y ď x=(z + w)/2; y=(z-w)/2, z + w > 0, z - w > 0, and 0< z < 1. 1 1 đ˝ = 2 2 = â1/2 1 1 â 2 2 z đ đ§, đ¤ = 1, for 0 < z < 1, z > -w, and z > w. đ§ đ đ§ = w đ(đ§, đ¤) đđ¤ âđ§ đ§ zâw=0 = 1 1 đđ¤ = đ¤ âđ§ 1 0 =1 2 -1 for 0 < z < 1, z > -w, and z > w. đ§ = 2đ§ âđ§ for 0 < z < 1. x đ đ§, đ¤ = 2 â â zâw=0 1 z 0 1 -1 z+w=0 1 z+w=0 37 38 đđĽ Previous Example: g đĽ1 , đŚ = đ(đĽ1 , đĽ2 ) â đđŚ2 Example: Let random variables X1 and X2 have the joint p.d.f. as Example: Let random variables X1 and X2 have the joint p.d.f. as 2, for đĽ > 0, đŚ > 0, đĽ + đŚ < 1, 0, elsewhere find the marginal p.d.f. of Z = X + Y . đ đĽ, đŚ = đ(đĽ, đ§) đđĽ 0 đ§ = 0 zâx=0 1 đ§ 2 đđĽ = 2đĽ = 2đ§ 0 x 0 1 39 for 0 < z < 1. 0 1 â đŚ2 đŚ1 â3/2 2 1 đŚ1 = <y2< đŚ1 y2 1 2đŚ1 y22 = y1 1 y22 < y1 đŚ2 đ đŚ1 , đŚ2 = 4 đŚ1 â đ˝ đŚ1 0 = 4y2 /2y1 =2y2 /y1 for 0 < y2< đŚ1 1 y1 40 Theorem 7.3 (Generalized Version): If X1, X2, âŚ, Xn Y1 ~ u1(x1, x2 , ⌠, xn) Y2 ~ u2(x1, x2 , ⌠, xn) ⌠Yn ~ un(x1, x2 , ⌠, xn) are independent random variables with m.g.f.âs is M X i (t ) i = 1, 2,âŚ, n, then the m.g.f. of Y ď˝ ďĽ n i ď˝1 i a X i is n g(x1, x2 , ⌠, xn) = f(x1, x2 , ⌠, xn)ď|J| đđĽ1 đđŚđ ⹠⎠đđĽđ ⯠đđŚđ đ˝= 1 2 đŚ1 7.5 Moment-Generating Function Technique X1, X2 , ⌠, Xn ~ f(x1, x2 , ⌠, xn) đđĽ1 đđŚ1 đ˝= ⎠đđĽđ đđŚ1 đŚ2 ,0 đŚ1 y1 = x12 and y2 = x1x2 ď x1= đŚ1 , x2 = z = x + y ď y = z â x for 0 < z < 1 and 0 < z â x . đđŚ đ đĽ, đ§ = đ(đĽ, đŚ) â = 2â 1 = 2 z đđ§ đ§ đ đ§ = 4đĽ1 đĽ2 , for 0 < đĽ1 < 1,0 < đĽ2 < 1 0, elsewhere a) find the joint p.d.f. of Y1 = X12 and Y2 = X1 X2 . đ đĽ1 , đĽ2 = M Y (t ) ď˝ ď M X i (ai t ) i ď˝1 ⌠41 42 FRV - 7 Function of Random Variables Example: Find the probability distribution of the sum of n independent random variables X1, X2, âŚ, Xn that have Poisson distribution with parameters l1, l2, âŚ, ln , respectively. The m.g.f. of Poisson distribution is M X (t ) ď˝e i Example: Find the probability distribution of the sum of n independent random variables X1, X2, âŚ, Xn that have Poisson distribution with parameters l1, l2, âŚ, ln , respectively. li ( e t -1) So, for Y = X1+ X2 + âŚ+ Xn , the m.g.f. is n n M Y (t ) ď˝ ď e li ( e -1) ď˝ e ( l1 + l2 +ď+ ln )( e -1) t i ď˝1 which is the m.g.f. of a Poisson distribution with parameter l = l1+ l2 + âŚ+ ln , therefore, Y has a Poisson distribution with l = l1+ l2 + âŚ+ ln . t t i ď˝1 43 which is the m.g.f. of a Poisson distribution with parameter l = l1+ l2 + âŚ+ ln , therefore, Y has a Poisson distribution with l = l1+ l2 + âŚ+ ln . 44 Sol: Example: If X1, X2, âŚ, Xn are mutually independent random variables from normal distributions with means m1, m2, m3, âŚ, mn, and variances s12, s22, s32, âŚ, sn2, then the linear function n n i ď˝1 i ď˝1 M Y (t ) ď˝ ď M X i (ci t ) ď˝ ď e mi ci t +s i ci t n Y ď˝ ďĽ ci X i ď˝e i ď˝1 has the normal distribution N(Scimi , Sci2si2). 2 2 2 /2 ďŠďŚ n ďś ďŚ n 2 2 ďśt2 ďš ďŞď§ ci m i ďˇ t + ď§ cis i ďˇ ďş ďˇ ď§ ďˇ2ďş ďŞďŤ ď§ď¨ i ď˝1 ď¸ ď¨ i ď˝1 ď¸ ďť ďĽ ďŚ ďĽ n n ďĽc m ,ďĽc s ď¨ m.g.f. of N ď§ i ď˝1 Sample Mean : Y ď˝ X li ( e t -1) So, for Y = X1+ X2 + âŚ+ Xn , the m.g.f. is M Y (t ) ď˝ ď e li ( e -1) ď˝ e ( l1 + l2 +ď+ ln )( e -1) t The m.g.f. of Poisson distribution is M X (t ) ď˝e i i i i ď˝1 2 2 i i ďś ďˇ ď¸ 1 if ci ď˝ . n 45 46 Distribution of X If X1, X2, âŚ, Xn are observations of a random sample of size n from the normal distribution N(m, s 2), then the distribution of the sample 1 n mean X ď˝ ďĽ X i is N(m, s 2/n) n i ď˝1 mX ď˝ m s sX ď˝ n 47 FRV - 8