27.4 NUMERICAL INTEGRATION
will have a very small variance. Further, any error in inverting the relationship
betweenηandξwill not be important sincef(η)/g(η) will be largely independent
of the value ofη.
As an example, consider the functionf(x)=[tan−^1 (x)]^1 /^2 , which is not analyt-
ically integrable over the range (0,1) but is well mimicked by the easily integrated
functiong(x)=x^1 /^2 (1−x^2 /6). The ratio of the two varies from 1.00 to 1.06 asx
varies from 0 to 1. The integral ofgover this range is 0.619 048, and so it has to
be renormalised by the factor 1.615 38. The value of the integral off(x)from0
to 1 can then be estimated by averaging the value of
[tan−^1 (η)]^1 /^2
(1.615 38)η^1 /^2 (1−^16 η^2 )
for random variablesηwhich are such thatG(η) is uniformly distributed on
(0,1). Using batches of as few as ten random numbers gave a value 0.630 forθ,
with standard deviation 0.003. The corresponding result for crude Monte Carlo,
using the same random numbers, was 0. 634 ± 0 .065. The increase in precision is
obvious, though the additional labour involved would not be justified for a single
application.
Control variates
The control-variate method is similar to, but not the same as, importance sam-
pling. Again, an analytically integrable function that mimicsf(x) in shape has
to be found. The function, known as the control variate, is first scaled so as to
matchfas closely as possible in magnitude and then its integral is found in
closed form. If we denote the scaled control variate byh(x), then the estimate of
θis computed as
t=
∫ 1
0
[f(x)−h(x)]dx+
∫ 1
0
h(x)dx. (27.51)
The first integral in (27.51) is evaluated using (crude) Monte Carlo, whilst the
second is known analytically. Although the first integral should have been ren-
dered small by the choice ofh(x), it is its variance that matters. The method relies
on the following result (see equation (30.136)):
V[t−t′]=V[t]+V[t′]−2Cov[t, t′],
and on the fact that iftestimatesθwhilstt′estimatesθ′using the same random
numbers, then the covariance oftandt′can be larger than the variance oft′,
and indeed will be so if the integrands producingθandθ′are highly correlated.
To evaluate the same integral as was estimated previously using importance
sampling, we take ash(x) the functiong(x) used there, before it was renormalised.
Again using batches of ten random numbers, the estimated value forθwas found
to be 0. 629 ± 0 .004, a result almost identical to that obtained using importance