NUMERICAL METHODS
averaged:
t=1
n∑ni=1f(ξi). (27.49)Stratified samplingHere the range ofxis broken up intoksubranges,
0=α 0 <α 1 <···<αk=1,and crude Monte Carlo evaluation is carried out in each subrange. The estimate
E[t] is then calculated as
E[t]=∑kj=1∑nji=1αj−αj− 1
njf(
αj− 1 +ξij(αj−αj− 1 )). (27.50)
This is an unbiased estimator ofθwith variance
σt^2 =∑kj=1αj−αj− 1
nj∫αjαj− 1[f(x)]^2 dx−∑kj=11
nj[∫
αjαj− 1f(x)dx] 2.This variance can be made less than that for crude Monte Carlo, whilst using
the same total number of random numbers,n=
∑
nj, if the differences betweenthe average values off(x) in the various subranges are significantly greater than
the variations infwithin each subrange. It is easier administratively to make all
subranges equal in length, but better, if it can be managed, to make them such
that the variations infare approximately equal in all the individual subranges.
Importance samplingAlthough we cannot integratef(x) analytically – we would not be using Monte
Carlo methods if we could – if we can find another functiong(x)thatcanbe
integrated analytically and mimics the shape offthen the variance in the estimate
ofθcan be reduced significantly compared with that resulting from the use of
crude Monte Carlo evaluation.
∫Firstly, if necessary the functiongmust be renormalised, so thatG(x)=
x
0 g(y)dyhas the propertyG(1) = 1. Clearly, it also has the propertyG(0) = 0.
Then, since
θ=∫ 10f(x)
g(x)dG(x),it follows that finding the expectation value off(η)/g(η) using a random number
η, distributed in such a way thatξ=G(η) is uniformly distributed on (0,1), is
equivalent to estimatingθ. This involves being able to find the inverse function
ofG; a discussion of how to do this is given towards the end of this subsection.
Ifg(η) mimicsf(η) well,f(η)/g(η) will be nearly constant and the estimation