John C. Turner
SM230 - Spring 1996
At times we are faced with a situation where we must deal not with the random variable whose distribution is know but rather with some function of the random variable. In the case of a simple linear function, we have already asserted what the effect is on the mean and variance. What has been omitted was what actually happens to the distribution.
Suppose we have a random variable X with cdf F(x). Let Y=g(X) be a function of X. We need that g(X) be invertible, at least in pieces. This means that we can solve for X in terms of Y. If Y=aX+b, then X=(Y-b)/a. If Y=X2, then X=sqrt(Y), where we must allow both the positive and negative roots. Here, we will discuss cases where g(X) is invertible over all the possible values of X, e.g., X=sqrt(Y), where X>0. If we were to allow both positive and negative values for X, we would treat each case separately and (sort of) add them together.
The procedure is to derive the cdf for Y=g(X) in terms of both the cdf of X, F(x), and the function, g(X), while also noting how the range of possible values changes. This is done by starting with the Prob(Y<t) and inverting this into a statement that can be expressed in terms of the cdf of X.
Example Suppose X has cdf given by F(t)=1-exp(-A t). Let Y=b X where b>0. Note that the range of Y is the same as the range of X, namely (0,infinity).
Prob(Y<t) = Prob(b X<t)
= Prob(X<t/b)(Since b>0, we leave the inequality alone.) = 1-exp(-A t/b)
= 1-exp(-A/b)t
The student should recognize the cdf of Y as the exponential distribution with parameter A/b . We already knew that the mean would be b/A , but we did not know that Y had an exponential distribution.
Example Suppose X has a uniform distribution on (a,b) and Y=c X+d, with c>0. Recall that F(t) = (t-a)/(b-a). Note that the range of Y is (ca+d, cb+d).
Prob(Y<t) = Prob(c X+d < t) = Prob(X < (t-d)/c) = F((t-d)/c) = ((t-d)/c - a)/(b-a) = (t-d-ac)/(c(b-a))With a little algebra, this can be shown to be the uniform cdf on (ca+d, cb+d).
This shows that certain simple transformations do not change the name of the distribution, only the parameters. Sometimes, however, the change is dramatic.
Example Show that if X has a uniform distribution on the interval (0,1) then Y=-ln(1-X) has an exponential distribution with mean 1. Recall that for the uniform distribution on (0,1), Prob(X<x)=x. Also, note that the range of Y is (0,infinity).
Prob(Y<t) = Prob(-ln(1-X) < t)
= Prob(ln(1-X)>-t)
= Prob(1-X>exp(-t) = Prob(X<1-exp(-t))
= 1-exp(-t)
Incidentally, note that if X has a uniform distribution on (0,1), then so does W=1-X. (Show this!)
One use of these methods is to generate random variables with a given distribution. This is important in simulation studies. Suppose that we have a complex operation that involves several components. Suppose that each component is a random variable and that the outcome of the operation depends on the components in a complicated way. One approach to analyzing such a system is to simulate each component and calculate the outcome for the simulated values. If we repeat the simulation many times, then we can get an idea of the probability distribution of the outcomes.
Many different kinds of random variables might be needed for our simulation. Most computers have a method for generating values that appear to have come from a uniform distribution on (0,1). (These are called pseudo-random numbers, because the computer always generates the same set. However, they have all the properties of a uniform random variable.) As we shall see, we can always start with such a random variable and then generate a random variable from any desired distribution.
Suppose that X has a uniform distribution on (0,1). Let F-1(t) be the inverse of a cdf. Then if we let Y=F-1(X), then Y is a random variable with cdf given by F(t). Note that (generally), cdf's of continuous random variables are strictly increasing functions, and thus have an inverse. For discrete random variables, we can define an inverse function that has the same property. For example, consider a binomial random variable with N=2 and p=3/4. The values of the random variable, the probability mass function and the cdf are given below.
y p(y) F(y) 0 1/16 1/16 1 6/16 7/16 2 9/16 1
Define H(x) so that
( 0 if x<1/16
H(x) = ( 1 if 1/16<x<7/16
( 2 if x>7/16
(We don't really care how H(x) is defined for x=1/16 or x=7/16. Since X is a continuous random variable, these events have probability 0.)
If we let Y=H(X), then Y will be a binomial random variable with N=2 and p=3/4. As a check, note that Prob(Y=1) = Prob(1/16<X<7/16) = 7/16 - 1/16 = 6/16, which is the desired probability mass function.
How do the descriptive measures of X relate to the measures of H(X)? Since we are only considering the case where H(x) is strictly monotone, the median of H(X) is H(Median(X)). The other quantiles of H(X) are simply related to H() evaluated at the quantiles of X. (If H(x) is decreasing, then obviously H() evaluated at the 0.25 quantile of X is the 0.75 quantile of H(X).) The expected value may be affected in unusual ways. Unless you recognize the distribution of Y, the only way to determine this is to differentiate the cdf, F(y), to get the pdf, f(y), and then use the definition of the mean to get E(Y).
Example Suppose X has a uniform distribution on (0,1) and Y=X^2. Note that Y is also defined on (0,1) and has cdf given by
F(t) = Prob(Y<t) = Prob(X^2<t) = Prob(X<sqrt(t) ) = sqrt(t)
Differentiating finds the pdf, f(t) f(t) = 1/(2 sqrt(t) )
Using the definition,
E(Y) = int_0^1 t f(t) dt
= int_0^1 t /(2 sqrt{t} ) dt
= int_0^1 (1/2) sqrt{t} dt
= (1/2) (2/3) t^3/2 ]01
=1/3
Note that this is the same as E(X^2). However, it is not the same as E(X)^2. It is a little larger.
Exercises