lecturenotes05

lecturenotes05 - MS&E 223 Simulation Peter J. Haas Lecture...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
MS&E 223 Lecture Notes #5 Simulation Generation Of Non-Uniform Random Numbers Peter J. Haas Spring Quarter 2009-10 Generation of Non-Uniform Random Numbers Refs : Law, Ch. 8, and Devroye, Non-Uniform Random Variate Generation (watch for typos!) Problem : Given a uniform random variable U, generate a random variable X having a prescribed cumulative distribution function F X ) ( . We previously discussed the inversion method. While inversion is a very general method, it may be computationally expensive. In particular, computing 1 X F() may have to be implemented via a numerical root-finding method in many cases. Therefore, we will now describe other methods for non-uniform random number generation. 1. Acceptance-Rejection Method We now discuss a method that is well-suited to generating random variates with an easily-calculated density. This method is called acceptance-rejection. Goal : Generate a random variate X having given probability density f X (x), where f X (x) is positive only on the interval [a, b] (where < a < b < - ). Enclose the density in a rectangle R having base (b a) and height m, where m = sup f (x) ax b X ≤≤ . f X (x) a b x m Suppose we throw down points uniformly in the rectangle R (denote these points by the symbol x). Throw away (or reject) the points above the density f X (x). Claim : The x-coordinate of each accepted point (denoted by the symbol ) has density f X (x). Proof : Let be the (x, y) coordinates of a random point distributed uniformly in R. Then, for a x b, 12 (Z ,Z ) . 11 P(Z x, acceptance) P(Z x , Z f (Z )) ≤= 2 X 1 1 But is just the probability that falls into the shaded region below: X P(Z x , Z f (Z )) Page 1 of 9
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
MS&E 223 Lecture Notes #5 Simulation Generation Of Non-Uniform Random Numbers Peter J. Haas Spring Quarter 2009-10 x a f X (t) t b This probability is just x X a f( t ) d t area(R) . Since 1 P(Z b) 1 = and the area under a pdf always equals 1, we also have b X a 1 t ) d t 1 P(acceptance) P(Z b,acceptance) area(R) area(R) =≤ = = . Putting these facts together, we have: x x 1a 1 a f(x)dx/area(R) P(Z x, acceptance) P(X x) P(Z x | acceptance) f (x)dx P(acceptance) 1/ area(R) ≤= = = = . as desired. Hence, acceptance-rejection works. A more precise specification of the algorithm is: 1. Generate as two independent U(0,1) random variates. 12 U,U 2. Set and [We are essentially using the inversion method here] 11 Za( ba ) U =+ − 2 Zm U = 2 ) 3. If , return . Else, go to 1. 2X 1 Zf ( Z 1 XZ = Note that the number of pairs N of uniform random variates required to generate X is geometrically distributed with mass function (U ,U ) , k1 P(N k) p(1 p) for k 1 == − where p = (area of R) -1 . The mean number of pairs that would be required is then E(N) = 1 p = area of R = (b a)m . Hence, a good measure of how fast such an acceptance-rejection algorithm will be is the closeness of the quantity (b a)m to 1. (So we want m to be as small as possible.) Page 2 of 9
Background image of page 2
MS&E 223 Lecture Notes #5 Simulation Generation Of Non-Uniform Random Numbers Peter J. Haas Spring Quarter 2009-10 2. Generalized Acceptance-Rejection
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 05/06/2010 for the course MSE 223 taught by Professor Unknown during the Spring '09 term at Stanford.

Page1 / 9

lecturenotes05 - MS&E 223 Simulation Peter J. Haas Lecture...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online