02.05.2014 Views

PENELOPE 2003 - OECD Nuclear Energy Agency

PENELOPE 2003 - OECD Nuclear Energy Agency

PENELOPE 2003 - OECD Nuclear Energy Agency

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

1.2. Random sampling methods 13<br />

can be generated from a single random number. Continuing with our graphical picture,<br />

assume that the N bars in the square are aligned consecutively to form a segment of<br />

length N (bottom of fig. 1.3). To sample x, we can generate a single random value<br />

ξN, which is uniformly distributed in (0,N) and determines one of the segment pieces.<br />

The result of the sampling is the label of the selected piece. Explicitly, the sampling<br />

algorithm proceeds as follows:<br />

(i) Generate a random number ξ and set R = ξN + 1.<br />

(ii) Set i = [R] and r = R − i.<br />

(iii) If r > F i , deliver x = K i .<br />

(iv) Deliver x = i.<br />

We see that the sampling of x involves only the generation of a random number and<br />

one comparison (irrespective of the number N of possible outcomes). The price we<br />

pay for this simplification reduces to doubling the number of memory locations that<br />

are needed: the two arrays K i and F i are used instead of the single array p i (or P i ).<br />

Unfortunately, the calculation of alias and cutoff values is fairly involved and this limits<br />

the applicability of Walker’s algorithm to distributions that remain constant during the<br />

course of the simulation.<br />

1.2.4 Rejection methods<br />

The inverse transform method for random sampling is based on a one-to-one correspondence<br />

between x and ξ values, which is expressed in terms of a single-valued function.<br />

There is another kind of sampling method, due to von Neumann, that consists of sampling<br />

a random variable from a certain distribution [different from p(x)] and subjecting<br />

it to a random test to determine whether it will be accepted for use or rejected. These<br />

rejection methods lead to very general techniques for sampling from any PDF.<br />

The rejection algorithms can be understood in terms of simple graphical arguments<br />

(fig. 1.4). Consider that, by means of the inverse transform method or any other available<br />

sampling method, random values of x are generated from a PDF π(x). For each sampled<br />

value of x we sample a random value y uniformly distributed in the interval (0, Cπ(x)),<br />

where C is a positive constant. Evidently, the points (x, y), generated in this way, are<br />

uniformly distributed in the region A of the plane limited by the x-axis (y = 0) and<br />

the curve y = Cπ(x). Conversely, if (by some means) we generate random points (x, y)<br />

uniformly distributed in A, their x-coordinate is a random variable distributed according<br />

to π(x) (irrespective of the value of C). Now, consider that the distribution π(x) is such<br />

that Cπ(x) ≥ p(x) for some C > 0 and that we generate random points (x, y) uniformly<br />

distributed in the region A as described above. If we reject the points with y > p(x),<br />

the accepted ones (with y ≤ p(x)) are uniformly distributed in the region between the<br />

x-axis and the curve y = p(x) and hence, their x-coordinate is distributed according to<br />

p(x).<br />

A rejection method is thus completely specified by representing the PDF p(x) as<br />

p(x) = Cπ(x)r(x), (1.47)

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!