Chapter 7. Functions of Random Variables
Transcript of Chapter 7. Functions of Random Variables
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL
Chapter 7. Functions of Random Variables
Sections 7.2 -- 7.4: Functions of Discrete Random Variables, Method of Distribution Functions and Method of Transformations in One Dimension
Jiaping Wang
Department of Mathematical Science
04/10/2013, Wednesday
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL
Outline Functions of Discrete Random Variables Methods of Distribution Functions Method of Transformations in One Dimension More Examples Homework #10
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL
Introduction
For example, there is a sample X1, X2, β¦, Xn from same distribution, also there is a function denoted by Y=f(X1, X2, β¦, Xn)=1/nβXi, which is a function of random variables {X1, X2, β¦, Xn}. Considering the discrete random variables, for example, X is a discrete random variables with space S={0, 1, 2, 3}, C is a function of X with C=150+50X, then we can have a mass probability table x 0 1 2 3
p(x) 0.5 0.3 0.15 0.05
c 150 200 250 300
p(c) 0.5 0.3 0.15 0.05
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL
Cont.
Considering X is a discrete random variables with space S={-1, 0, 1}, define Y=X2, then we can have a mass probability table as follows
x -1 0 1
p(x) 0.25 0.5 0.25
y 1 0 1
p(y) 0.25 0.5 0.25
y 0 1
p(y) 0.5 0.5
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL
Example 7.1
A quality control manager samples from a lot of items, testing each item until r defectives have been found. Find the distribution of Y, the number of items that are tested to obtain r defectives.
Answer: Assume that the probability p of obtaining a defective item is constant from trial To trial, the number of good items X sampled prior to the r-th defective one is a negative Binomial random variable. The mass function is π π = π₯ = π π₯ = π₯+πβ1
πβ1 ππππ₯, π₯ = 0, 1, 2, β¦ The number of trials, Y, is equal to the sum of the number of good items and defective Ones, that is, Y=X+r thus X=Y-r, with Y=r, r+1, r+2, β¦ so the mass function for Y is π π = π¦ = π π¦ = π¦β1
πβ1 ππππ¦ β π, π¦ = π, π + 1, π + 2, β¦
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL
Introduction
If X has a probability density function ππΏ(π), and Y is a function of X, we are interested in finding ππ(π) = π·(π β€π) or the density ππ(π) by using the distribution of X. For example, π = πΏπ with density ππΏ(π). For yβ₯0, ππ π = π· π β€ π = π· πΏπ β€ π = π· β π β€ πΏ β€ π = π· πΏ β€ π β π π β€ β π = ππΏ π β ππΏ β π . Then we can have the density function for Y: ππ π = π
π πππ π = π
π πππΏ π β π
π πππΏ β π
=π
π πππΏ π +
ππ π
ππΏ β π
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL
Application in Normal Distribution
X is standard normal random variable, what is the probability density function of Y=X2? We know ππ π₯ = 1
2πexp βπ₯2
2,ββ < π₯ < β, thus for yβ₯0,
ππ π¦ = 1
2 π¦[ 12π
exp β ( π¦)2
2+ 1
2πexp β (β π¦)2
2] = 1
2 πy β 1
2 exp(βy2)
Recall that Ξ 1
2= π, we can see Y follows a gamma distribution with
parameters Ξ±=1/2 and Ξ²=2.
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL
Answer: πΉπ(π¦) = π(π β€ π¦) = π(40(1 β π) β€ π¦) = π(π > 1 β π¦
40) =
β« 3π₯2ππ₯ = 1 β 1 β π₯40
3, 0 β€ π¦ β€ 40.11β π¦
40
For density function, we can obtain it by differentiating the distribution function ππ π¦ = 3
401 β x
402, 0 β€ π¦ β€ 40.
The proportion of time X that a lathe is in use during a typical 40-hour workweek is a random variable whose probability density function is given by
f x = οΏ½3π₯2, 0 β€ π₯ β€ 1
0, πππππππππ.
The actual number of hours out of a 40-hour week that the lathe is not in use then is Y=40(1-X). Find the probability density function for Y.
Example 7.2
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL
Example 7.5
Let X have the probability density function given by
π π₯ = οΏ½π₯ + 1
2, β1 β€ π₯ β€ 1
0, πππππππππ
Find the density function for Y=X2.
Answer: In the earlier section, we found that
ππ π =π
π π [ππΏ π + ππΏ β π ]
By substituting into this equation, we have
ππ π = ππ π
π+ππ
+ β π+ππ
= οΏ½ππ π
, π β€ π β€ π
π, πππππππππ
As βπ β€ π β€ π,π = ππ π β€ π β€ π
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL
Summary
Summary of the Distribution Function Method Let Y be a function of the continuous random variables X1, X2, β¦, Xn. Then 1. Find the region Y=y in the (X1, X2, β¦, Xn) space. 2. Find the region Yβ€y. 3. Find πΉπ(π¦) = π(π β€ π¦) by integrating π(π1,π2, β¦ ,ππ) over the region Yβ€y. 4. Find the density function fY(y) by differentiating FY(y). That is,
ππ π¦ = πππ¦πΉπ π¦ .
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL
Introduction
The transformation method for finding the probability distribution of a function of a random variable is simply a generalization of the distribution function method. Consider a random variable X with the distribution function FX(x). Suppose that Y is a function of X, say, Y=g(X) which is an increasing function with the inverse X=g-1(Y)=h(Y). Then We have πΉπ π¦ = π π β€ π¦ = π π π β€ π¦ = π π β€ π π¦ = πΉπ[π π¦ ] Then the density function is ππ π¦ = π
ππ¦πΉπ π¦ = π
ππ¦πΉπ π π¦ = ππ π π¦ β |πβ² π¦ |.
Similarly, we can have the same result for g(X) is a decreasing function.
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL
Theorem 7.1
Transformation of Random Variable. Let X be an absolute continuous random variable with probability density function
ππ π₯ = οΏ½> 0, π₯ β π΄ = (π, π)
0, π₯ β οΏ½Μ οΏ½
Let π = π(π) with inverse function π = π(π) such that h is a one-to-one, continuous function from π΅ = (πΌ,π½) onto A. If πβ(π¦) exists and πβ(π¦) β 0 for all y β π΅. Then π = π(π) determines a new random variable with density
ππ π¦ = οΏ½ππ π π¦ |πβ² π¦ |, π¦ β π΅ = (πΌ,π½)
0, π¦ β π΅οΏ½
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL
Example 7.6
Let X have the probability density function given by
π π₯ = οΏ½2π₯, 0 β€ π₯ β€ 10, πππππππππ
Find the density function for Y=-2X+5.
Answer: Here π = π(π) = β2π + 5 the inverse function π = π π = 5βπ2
where h is a continuous and one-to-one function from B=(3,5) onto A=(0,1). So πβ(π¦) = β1/2 for any y β π΅ . Then we can have ππ π¦ = ππ π π¦ πβ² π¦ = 2 5βπ¦
2β 12
= 5βπ¦2
, 3 < π¦ < 5.
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL
Summary
Summary of the Univariate Transformation Method Let Y be the function of the continuous random variables X, Y=g(X). Then 1. Write the probability density function of X. 2. Find the inverse function h such that X=h(Y). Verify that h is a continuous
one-to-tone function from B=(Ξ±, Ξ²) onto A=(a, b) where for π₯ β π΄, π π₯ >0.
3. Verify πππ¦π π¦ = πβ²(π¦) exists, and is not zero for any π¦ β π΅.
4. Find ππ(π¦) by calculating ππ π π¦ |πβ² π¦ |
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL
Additional Example 1
Let X be a random variable having a continuous c.d.f., F(x). Let Y=F(X). Show that Y has a uniform distribution on (0,1). Conversely, if U has a uniform distribution on (0,1), show that X = F-1(U) has the c.d.f, F(x).
Answer: F(X) is non-decreasing and has domain 0<F(X)<1, that is, 0<Y<1. Suppose F(x) has inverse function, ie., y=F(x)x=F-1(y). Then FY(y)=P(Y β€ y)=P[F(X) β€ y]=P[X β€F-1(y)]=F(F-1(y))=y fY(y)=1, for 0<y<1. FX(x)=P(X β€x)=P(F-1(U) β€x)=P(U β€F(x))=F(x).
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL
Additional Example 2
Show that if U is uniform on (0,1), then X=-log(U) has an exponential distribution Exp(1).
Answer: The density function for U is fU(u)=1. X=-log(U) U=exp(-X), so h(x)=e-x, which is continuous and one-to-one function with B=(0, β) as A=(0, 1). The derivative of h(x) is hβ(x)=-e-x which is not zero in the domain. So we can have fX(x) =fU[h(x)]|hβ(x)|=(1)(|-e-x|)=e-x.