<< Chapter < Page Chapter >> Page >
This course is a short series of lectures on Introductory Statistics. Topics covered are listed in the Table of Contents. The notes were prepared by EwaPaszek and Marek Kimmel. The development of this course has been supported by NSF 0203396 grant.

The iverse probability method for generating random variables

Once the generation of the uniform random variable is established, it can be used to generate other types of random variables.

The continuous case

THEOREM I

Let X have a continuous distribution F X ( x ) , so that F X 1 ( α ) exists for 0 < α < 1 (and is hopefully countable). Then the random variable F X 1 ( U ) has distribution F X ( x ) , U is uniformly distributed on (0,1).

PROOF

P ( F X 1 ( U ) x ) = P ( F X ( F X 1 ( U ) ) F X ( x ) ) .

Because F X ( x ) is monotone. Thus,

P ( F X 1 ( U ) x ) = P ( U F X ( x ) ) = F X ( x ) .

The last step follows because U is uniformly distributed on (0,1). Diagrammatically, we have that ( X x ) if and only if [ U F X ( x ) ] , an event of probability F X ( x ) .

As long as we can invert the distribution function F X ( x ) to get the inverse distribution function F X 1 ( α ) , the theorem assures us we can start with a pseudo-random uniform variable U and turn into a random variable F X 1 ( U ) , which has the required distribution F X ( x ) .

The Exponential Distribution

Consider the exponential distribution defined as

α = F X ( x ) = { 1 e λ x , λ > 0, x 0, 0, x < 0.

Then f or the inverse distribution function we have

x = 1 λ ln ( 1 α ) = F 1 ( α ) .

Thus if U is uniformly distributed on 0 to 1, then X = 1 λ ln ( 1 U ) has the distribution of an exponential random variable with parameter λ. We say, for convenience, that X is exponential (λ).

If U is uniform (0,1), then so is (1- U ), and the pair U and (1- U ) are interchangeable in terms of distribution. Hence, X ' = 1 λ ln ( U ) is exponential. However, the two variables X and X’ are correlated and are known as an antithetic pair .
Got questions? Get instant answers now!

Normal and Gamma Distributions

For both these cases there is no simple functional form for the inverse distribution F X 1 ( α ) , but because of the importance of the Normal and Gamma distribution models, a great deal of effort has been expended in deriving good approximations.

The Normal distribution is defined through its density,

f X ( x ) = 1 2 π σ exp [ ( x μ ) 2 2 σ 2 ] .

So that,

F X ( x ) = 1 2 π σ exp [ ( x u ) 2 2 σ 2 ] d v .

The normal distribution function F X ( x ) is also often denoted Φ ( x ) , when the parameter u and σ are set to 0 to 1, respectively. The distribution has no closed-form inverse, F X 1 ( α ) , but the inverse is needed do often that Φ 1 ( α ) , like logarithms or exponentials, is a system function.

The inverse of the Gamma distribution function, which is given by

F X ( x ) = 1 Γ ( k ) 0 k x / u v k 1 e v d v , x 0, k > 0, u > 0.

Is more difficult to compute because its shape changes radically with the value of k . It is however available on most computers as a numerically reliable function.

Got questions? Get instant answers now!

The Normal and Gamma Distributions

A commonly used symmetric distribution, which has a shape very much like that of the Normal distribution, is the standardized logistic distribution.

F X ( x ) = e x 1 + e x = 1 1 + e x , < x < ,

with probability density function

F X ( x ) = e x 1 + e x = 1 1 + e x , < x < .
F X ( ) = e / ( 1 + e ) = 0 and F X ( ) = 1 by using the second form for F X ( x ) .

The inverse is obtained by setting α = e x 1 + e x . Then, α + α e x = e x or α = e x ( 1 α ) .

Therefore, x = F X 1 ( α ) = ln α ln ( 1 α ) .

And the random variable is generated, using the inverse probability integral method. As follows X = ln U ln ( 1 U ) .

Got questions? Get instant answers now!

The discrete case

Let X have a discrete distribution F X ( x ) that is, F X ( x ) jumps at points x k = 0,1,2,... . Usually we have the case that x k = k , so that X is an integer value.

Let the probability function be denoted by

p k = P ( X = x k ) , k = 0,1,....

The probability distribution function is then,

F X ( x k ) = P ( X x k ) = j k p j , k = 0,1,...,

and the reliability or survivor function is

R X ( x k ) = 1 F X ( x k ) = P ( X > x k ) , k = 0,1,....

The survivor function is sometimes easier to work with than the distribution function, and in fields such as reliability, it is habitually used. The inverse probability integral transform method of generating discrete random variables is based on the following theorem.

THEOREM

Let U be uniformly distributed in the interval (0,1). Set X = x k whenever F X ( x k 1 ) < U F X ( x k ) , for k = 0,1,2,... with F X ( x 1 ) = 0 . Then X has probability function p k .

PROOF

By definition of the procedure,

X = x k if and only if F X ( x k 1 ) < U F X ( x k ) .

Therefore,

P ( X = x k ) = P F X ( ( x k 1 ) < U F X ( x k ) ) = F X ( x k ) F ( x k 1 ) = p k .

By the definition of the distribution function of a uniform (0,1) random variable.

Thus the inverse probability integral transform algorithm for generating X is to find x k such that U F X ( x k ) and U > F X ( x k 1 ) and then set X = x k .

In the discrete case, there is never any problem of numerically computing the inverse distribution function, but the search to find the values F X = ( x k ) and F X ( x k 1 ) between which U lies can be time-consuming, generally, sophisticated search procedures are required. In implementing this procedure, we try to minimize the number of times one compares U to F X = ( x k ) . If we want to generate many of X , and F X = ( x k ) is not easily computable, we may also want to store F X = ( x k ) for all k rather than recomputed it. Then we have to worry about minimizing the total memory to store values of F X = ( x k ) .

The Binary Random Variable

To generate a binary-valued random variable X that is 1 with probability p and 0 with probability 1- p , the algorithm is:

  • If U p , set X =1.
  • Else set X =0.
Got questions? Get instant answers now!

The Discrete Uniform Random Variable

Let X take on integer values between and including the integers a and b , where a b , with equal probabilities. Since there are ( b a + 1 ) distinct values for X , the probability of getting any one of these values is, by definition, 1 / ( b a + 1 ) . If we start with a continuous uniform (0,1) random number U , then the discrete inverse probability integral transform shows that

X = integer part of [ ( b a + 1 ) U + a ] .

The continuous random variable [ ( b a + 1 ) U + a ] is uniformly distributed in the open interval ( a , b + 1 ) .
Got questions? Get instant answers now!

The Geometric Distribution

Let X take values on zero and the positive integers with a geometric distribution. Thus,

P ( X = k ) = p k = ( 1 ρ ) ρ k , k = 0 , 1 , 2 , .... , 0 < ρ < 1 ,

and

P ( X k ) = F X ( k ) = 1 ρ k + 1 , k = 0 , 1 , 2 , .... , 0 < ρ < 1.

To generate geometrically distributed random variables then, you can proceed successively according to the following algorithm:

  • Compute F X ( 0 ) = 1 ρ . Generate U .
  • If U F X ( 0 ) set X =0 and exit.
  • Otherwise compute F X ( 1 ) = 1 ρ 2 .
  • If U F X ( 1 ) set X =1, and exit.
  • Otherwise compute F X ( 2 ) , and so on.
Got questions? Get instant answers now!

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, Introduction to statistics. OpenStax CNX. Oct 09, 2007 Download for free at http://cnx.org/content/col10343/1.3
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Introduction to statistics' conversation and receive update notifications?

Ask