Spring 2010
Pstat160b
HO #5
Simulation of Continuous Random Variables
The starting point of all simulations methods is uniform
U
(0
,
1) random variable. Those are obtained
from (pseudo) random number generator, which we assume are available to us. Note that any uniform
random variables
U
(
a,b
) can be generated from those by setting
X
=
a
+ (
b

a
)
*
U
. Also Bernoulli
random variables (value 1 with probability
p
, 0 with probability 1

p
) can be generated by setting
X
= 1
if
U < p
, and
X
= 0 if
U > p
.
Inverse transform method
Suppose we want to simulate a continuous random variable with C.d.f
F
X
(
x
) (here to simplify notation
we just write
F
(
x
). Since a C.d.f is increasing and here assumed to be continuous, its inverse function
F

1
is well deﬁned as (see also graphs below). If
F
is strictly increasing, there is no ambiguity and
F

1
is given by
F

1
(
y
) =
x
such that
F
(
x
) =
y
If there are intervals on which
F
is “ﬂat”, then all the
x
in that interval return the same
y
. To be well
deﬁned, we chose the smallest such
x
as the value of the inverse.
The inverse transform algorithm just consists of selecting
U
, a uniform
U
(0
,
1) random variable, and set
X
=
F

1
(
U
). Note that if
F
is constant on some interval, this deﬁnition give a correct answer, regardless
of the particular choice of the inverse since the probability of a single point for the uniform
U
(0
,
1) is 0
anyway.

This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
This is the end of the preview.
Sign up
to
access the rest of the document.
 Spring '10
 bonnet
 Probability theory, @, ... ..., Cumulative distribution function

Click to edit the document details