Sampling 285
algorithms. Otherwise, a very large sample will be needed beforeI ̃Mbecomes a good
estimator for the integral.
7.3 Sampling distributions
7.3.1 Sampling simple distributions
In Section 3.8.3, we showed how to sample a Gaussian distribution usingthe Box–
Muller method. In that context, we introduced some of the basic principles underlying
sampling schemes. Here, we review and generalize the discussion forarbitrary distri-
bution functions.
Consider a simple one-dimensional distribution functionf(x),x∈[a,b] satisfying
f(x)≥0 on the interval [a,b] and normalized such that
∫b
a
f(x)dx= 1. (7.3.1)
Sincef(x) is normalized, the value of an integral of the form
P(X) =
∫X
a
f(x)dx, (7.3.2)
with X ∈ [a,b], lies in the interval [0,1].P(X) measures the probability that a
particularxrandomly chosen from the distributionf(x) lies in the interval [a,X].
Becausef(x)≥0,P(X) is a monotonically increasing function ofX. Note also that
f(X) = dP/dX.
Now, suppose we perform a variable transformation fromxtoy, wherey=g(x)
andg(x) is a nondecreasing function ofx. In this case, ifX≥x, theng(X)≥g(x),
and the probabilityP ̃(Y) thatg(X) =Y≥y=g(x) must be equal to the probability
thatX ≥x, since the functionguniquely maps each value ofxonto a value ofy.
Thus, the cumulative probabilitiesP ̃(Y) andP(X) are equal:
P ̃(Y) =P(X). (7.3.3)
Conventional random number generators produce random sequences that are uni-
formly distributed on the interval [0,1]. (In actuality, the numbers are not truly random
since they are generated by a deterministic algorithm. Thus, they are more accurately
calledpseudorandom numbers, although it is conventional to refer to them as “ran-
dom.”) Ifris a random number, it will have a probability distributionw(r) given
by
w(r) =
{
1 0≤r≤ 1
0 otherwise
. (7.3.4)
The cumulative probabilityW(ξ) is then
W(ξ) =
∫ξ
0
w(r) dr=
0 ξ < 0
ξ 0 ≤ξ≤ 1
1 ξ > 1
. (7.3.5)
The functionW(ξ) =ξforξ∈[0,1] is the probability that a random numberrchosen
by a random number generator lies in the interval [0,ξ]. Let us assume that there