Transforming a Random Variable - Lecture Notes | STAT 3401, Study notes of Probability and Statistics

Material Type: Notes; Class: Introduction to Probability Theory I; Subject: Statistics; University: California State University-East Bay; Term: Unknown 1989;

Typology: Study notes

Pre 2010

Uploaded on 02/24/2010

koofers-user-5oc
koofers-user-5oc 🇺🇸

10 documents

1 / 11

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Transforming a Random Variable
Our purpose is to show how to find the density function fY of the
transformation Y = g(X) of a random variable X with density
function fX.
Let X have probability density function (PDF) fX(x) and
let Y = g(X).
We want to find the PDF fY(y) of the random variable Y.
pf3
pf4
pf5
pf8
pf9
pfa

Partial preview of the text

Download Transforming a Random Variable - Lecture Notes | STAT 3401 and more Study notes Probability and Statistics in PDF only on Docsity!

Transforming a Random Variable

Our purpose is to show how to find the density function f Y of the

transformation Y = g ( X ) of a random variable X with density

function f X.

Let X have probability density function (PDF) f X ( x ) and

let Y = g ( X ).

We want to find the PDF f Y ( y ) of the random variable Y.

Geometrical Example.

Suppose X ~ UNIF(0, 1) = BETA(1, 1) and that Y = X^2 = g ( X ).

We know that f (^) X ( x ) = I (0,1)( x ).

(Here, we use the indicator function:

IA ( x ) = 1 for xA and IA ( x ) = 0 otherwise.)

The support of the random variable X is the unit interval (0, 1). It is crucial in transforming random variables to begin by finding the support of the transformed random variable. Here the support of Y is the same as the support of X.

Now we approximate f (^) Y by seeing what the transformation does to each of the intervals (0, 0.1), (0.1, 0.2), ..., (0.0, 1.0). In the table below, these intervals are in the “ x -Interval” column.

Each of these intervals has length 0.1. The height of f (^) X ( x ) is 1in each interval, so area or probability in within each interval is 0.1:

P(0 < X < 0.1) = P(0.1 < X < 0.2) = ... = P(0.9 < X < 1) = 0.1.

The “ y -Interval” column of the table shows the transform of each interval. Clearly, the transformed random variable Y must have

P(0 < Y < 0.01) = P(0.01 < Y < 0.04) = ... = P(0.81 < Y < 1) = 0.1.

Taking into account the (unequal) lengths of the y -intervals, we can see what the (average) height of the f (^) Y must be above each y -interval in order to preserve the probability of the interval under transformation.

The results are shown in the column “ y -Height” and plotted in the rectangles of the graph on the next page.

CDF method.

A more formal approach to finding f (^) Y goes as follows.

The cdf of X is FX ( x ) = x , for 0 < x < 1. Thus the cdf of Y can be found as

FY ( y ) = P( Yy ) = P( X^2 ≤ y ) = P( Xy 1/2) = y 1/2, for 0 < y < 1.

Differentiating, we have the density function of Y :

FY '( y ) = f (^) Y ( y ) = (1/2) y –1/2 I (0,1)( y ).

Thus, we have shown that Y ~ (^) BETA(1/2, 1). (Not all transforms Y = X k^ of a beta random variable X are beta.)

The density function of Y is plotted in the figure.

This method of finding the distribution of a transformed random variable is called the cdf-method. It is very widely applicable.

Exercises:

  1. Use the cdf method to verify the functional form of the density function of Y = 2 X^2 where X ~ BETA(2, 1).
  2. Find the density function of Y = X 1/2^ where X ~ UNIF(0, 1).

PDF method.

For monotone increasing or decreasing functions g , the CDF method can be carried out in general, allowing one to deal only with PDFs.

In our example, within the support of X , the function y = g ( x ) = x^2 is monotone increasing.

For any function y = g ( x ) that is monotone increasing on the support of X , we may carry out the CDF method in a general way:

FY ( y ) = P( Yy ) = P( g ( X ) ≤ y ) = P( Xg –1^ ( y )) = FX ( g –1^ ( y )).

Whether or not we know the exact functional form of FX , differentiation gives

f (^) Y ( y ) = d FX ( g –1( y )) / dy = f (^) X ( g –1( y )) d g –1^ ( y ) / dy ,

for y in the support of Y, provided that g is a monotone increasing function.

The factor with the derivative of g –1^ results from applying the chain rule of differentiation.

For the example where y = g ( x ) = x^2 , we have

g –1( y ) = x 1/2^ and d g –1( y ) / dx = (1/2) y –1/2.

Geometrical interpretation.

Referring back to the geometrical illustration, the expression

| d g –1( y ) / dy | = | dx / dy |

can be viewed as the appropriate multiple to compensate

for the change in the length of a small interval ∆ x , as g transforms it to ∆ y , in order to ensure that

P( X ∈ ∆ x ) = P( Y ∈ ∆ y ).

Note: If the transforming function is not monotone on the support of X ,

it is often best to use the cdf method.

Advanced Exercises:

  1. If X is standard normal, show that X^2 has a chi-squared distribution with 1 degree of freedom. Hint: What is the density function of V = | X |? Then use the PDF method to find the density function of V^2.
  2. Do Problem 5 using generating functions. Hint: Find E[exp( tX^2 )] using the standard normal density. Complete the square. Recognize the integral of a density that must equal 1. Compare the simplified result with the MGF of CHISQ(1).

Square of standard uniform with larger sample; also with more histogram bins (as specified by breaks parameter).

m <- 500000 x <- runif(m) y <- x^ hist(y, breaks=50, freq=F) yy <- seq(0, 1, by=.001) lines(yy, dbeta(yy, .5, 1))

Square of standard normal with density of CHISQ(1) superimposed (see exercise above).

m <- 100000 x <- rnorm(m) y <- x^ hist(y, freq=F, xlim=c(0,10)) yy <- seq(0, 10, by=.0001) lines(yy, dchisq(yy, 1))

Advanced Exercise:

  1. Use simulation to illustrate that the sum of the squares of two independent standard normal random variables is exponential with mean 2 (rate 1/2).

Copyright © 2002, 2003, 2004 by Bruce E. Trumbo. All rights reserved.