12.07.2015 Views

COPYRIGHT 2008, PRINCETON UNIVERSITY PRESS

COPYRIGHT 2008, PRINCETON UNIVERSITY PRESS

COPYRIGHT 2008, PRINCETON UNIVERSITY PRESS

SHOW MORE
SHOW LESS
  • No tags were found...

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

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

144 chapter 6The crux of this technique is being able to invert (6.63) to obtain x = W −1 (r).Let us look at some analytic examples to get a feel for these steps (numericalinversion is possible and frequent in realistic cases).Uniform weight function w: We start with the familiar uniform distributionw(x)={ 1b−a, if a ≤ x ≤ b,0, otherwise.(6.66)After following the rules, this leads toW (x)=∫ xadx ′ 1b − a = x − ab − a(6.67)⇒ x = a +(b − a)W ⇒ W −1 (r)=a +(b − a)r, (6.68)where W (x) is always taken as uniform. In this way we generate uniformrandom 0 ≤ r ≤ 1 and uniform random a ≤ x ≤ b.Exponential weight: We want random points with an exponential distribution:{ 1λw(x)=e−x/λ , for x>0,0, for x0. Notice thatour prescription (6.53) and (6.54) tells us to use w(x)=e −x/λ /λ to remove theexponential-like behavior from an integrand and place it in the weights andscaled points (0 ≤ x i ≤∞). Because the resulting integrand will vary less, itmay be approximated better as a polynomial:∫ ∞0dx e −x/λ f(x) ≃ λ NN∑f(x i ), x i = −λ ln(1 − r i ). (6.70)i=1Gaussian (normal) distribution: We want to generate points with a normaldistribution:w(x ′ )= 1 √2πσe −(x′ −x) 2 /2σ 2 . (6.71)This by itself is rather hard but is made easier by generating uniform distributionsin angles and then using trigonometric relations to convert themto a Gaussian distribution. But before doing that, we keep things simple by−101<strong>COPYRIGHT</strong> <strong>2008</strong>, PRINCET O N UNIVE R S I T Y P R E S SEVALUATION COPY ONLY. NOT FOR USE IN COURSES.ALLpup_06.04 — <strong>2008</strong>/2/15 — Page 144

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

Saved successfully!

Ooh no, something went wrong!