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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

1.2. Random sampling methods 9<br />

Numerical inverse transform<br />

The inverse transform method can also be efficiently used for random sampling from<br />

continuous distributions p(x) that are given in numerical form, or that are too complicated<br />

to be sampled analytically. To apply this method, the cumulative distribution<br />

function P(x) has to be evaluated at the points x i of a certain grid. The sampling<br />

equation P(x) = ξ can then be solved by inverse interpolation, i.e. by interpolating in<br />

the table (ξ i ,x i ), where ξ i ≡ P(x i ) (ξ is regarded as the independent variable). Care<br />

must be exercised to make sure that the numerical integration and interpolation do not<br />

introduce significant errors.<br />

(a)<br />

(b)<br />

p (x)<br />

p (x)<br />

x<br />

x<br />

Figure 1.2: Random sampling from a continuous distribution p(x) using the numerical inverse<br />

transform method with N = 20 intervals. a) Piecewise constant approximation. b) Piecewise<br />

linear approximation.<br />

A simple, general, approximate method for numerical sampling from continuous<br />

distributions is the following. The values x n (n = 0, 1, . . . , N) of x for which the<br />

cumulative distribution function has the values n/N,<br />

P(x n ) =<br />

∫ xn<br />

x min<br />

p(x) dx = n N , (1.37)<br />

are previously computed and stored in memory. Notice that the exact probability of<br />

having x in the interval (x n , x n+1 ) is 1/N. We can now sample x by linear interpolation:

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

Saved successfully!

Ooh no, something went wrong!