13.07.2015 Views

Mathematical Methods for Physics and Engineering - Matematica.NET

Mathematical Methods for Physics and Engineering - Matematica.NET

Mathematical Methods for Physics and Engineering - Matematica.NET

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

27.4 NUMERICAL INTEGRATIONwill have a very small variance. Further, any error in inverting the relationshipbetween η <strong>and</strong> ξ will not be important since f(η)/g(η) will be largely independentof the value of η.As an example, consider the function f(x) =[tan −1 (x)] 1/2 , which is not analyticallyintegrable over the range (0, 1) but is well mimicked by the easily integratedfunction g(x) =x 1/2 (1 − x 2 /6). The ratio of the two varies from 1.00 to 1.06 as xvaries from 0 to 1. The integral of g over this range is 0.619 048, <strong>and</strong> so it has tobe renormalised by the factor 1.615 38. The value of the integral of f(x) from0to 1 can then be estimated by averaging the value of[tan −1 (η)] 1/2(1.615 38) η 1/2 (1 − 1 6 η2 )<strong>for</strong> r<strong>and</strong>om variables η which are such that G(η) is uni<strong>for</strong>mly distributed on(0, 1). Using batches of as few as ten r<strong>and</strong>om numbers gave a value 0.630 <strong>for</strong> θ,with st<strong>and</strong>ard deviation 0.003. The corresponding result <strong>for</strong> crude Monte Carlo,using the same r<strong>and</strong>om numbers, was 0.634 ± 0.065. The increase in precision isobvious, though the additional labour involved would not be justified <strong>for</strong> a singleapplication.Control variatesThe control-variate method is similar to, but not the same as, importance sampling.Again, an analytically integrable function that mimics f(x) in shape hasto be found. The function, known as the control variate, is first scaled so as tomatch f as closely as possible in magnitude <strong>and</strong> then its integral is found inclosed <strong>for</strong>m. If we denote the scaled control variate by h(x), then the estimate ofθ is computed ast =∫ 10[f(x) − h(x)] dx +∫ 10h(x) dx. (27.51)The first integral in (27.51) is evaluated using (crude) Monte Carlo, whilst thesecond is known analytically. Although the first integral should have been renderedsmall by the choice of h(x), it is its variance that matters. The method relieson the following result (see equation (30.136)):V [t − t ′ ]=V [t]+V [t ′ ] − 2Cov[t, t ′ ],<strong>and</strong> on the fact that if t estimates θ whilst t ′ estimates θ ′ using the same r<strong>and</strong>omnumbers, then the covariance of t <strong>and</strong> t ′ can be larger than the variance of t ′ ,<strong>and</strong> indeed will be so if the integr<strong>and</strong>s producing θ <strong>and</strong> θ ′ are highly correlated.To evaluate the same integral as was estimated previously using importancesampling, we take as h(x) the function g(x) used there, be<strong>for</strong>e it was renormalised.Again using batches of ten r<strong>and</strong>om numbers, the estimated value <strong>for</strong> θ was foundto be 0.629 ± 0.004, a result almost identical to that obtained using importance1013

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

Saved successfully!

Ooh no, something went wrong!