MS&E 223
Lecture Notes #5
Simulation
Generation Of NonUniform Random Numbers
Peter J. Haas
Spring Quarter 200910
Generation of NonUniform Random Numbers
Refs
: Law, Ch. 8,
and Devroye,
NonUniform 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
rootfinding method in many cases. Therefore, we will now describe other methods for nonuniform
random number generation.
1.
AcceptanceRejection Method
We now discuss a method that is wellsuited to generating random variates with an easilycalculated
density.
This method is called acceptancerejection.
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)
a
x
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 xcoordinate 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,
1
2
(Z ,Z )
≤
.
1
1
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:
1
2
X
P(Z
x , Z
f (Z ))
≤
≤
1
2
(Z ,Z )
Page 1 of 9
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document