
230 16. Stochastic Differential Equations
can be used to approximate E[X]. Standard statistical results
3
can be used to
show that in the asymptotic M → ∞ limit, the range
"
a
M
−
1.96
p
var[X]
√
M
, a
M
+
1.96
p
var[X]
√
M
#
(16.9)
is a 95% confidence interval for E[X]. This may be understood as follows: if we
were to repeat the computation of a
M
in (16.8) many times, each time using
fresh samples from our pseudo-random number generator, then the statement
“the exact mean lies in this interval” would be true 95% of the time. In practice,
we typically do not have access to the exact variance, var[X], which is required
in (16.9). From (16.4) we see that the variance is itself a particular case of
an expected value, so the idea in (16.8) can be repe ated to give the sample
variance
b
2
M
:=
1
M
M
X
i=1
(ξ
i
− a
M
)
2
.
Here, the unknown expected value E[X] has been replaced by the sample mean
a
M
.
4
Hence, instead of (16.9) we may use the more practical alternative
"
a
M
−
1.96
p
b
2
M
√
M
, a
M
+
1.96
p
b
2
M
√
M
#
. (16.10)
As an illustration, consider a random variable of the form
X = e
−1+2Y
, where Y ∼ N(0, 1).
In this case, we can com pute samples by calling a standard normal pseudo-
random number generator, scaling the output by 2 and shifting by −1 and
then exponentiating. Table 16.1 s hows the sample means (16.8) and confidence
intervals (16.10) that arose when we used M = 10
2
, 10
3
, . . . , 10
7
. For this simple
example, it can be shown that the exact mean has the value E[X] = 1 (see
Exercise 16.4) so we can judge the accuracy of the results. Of course, this
type of computation, which is known as a Monte Carlo simulation, is useful in
those circumstances where the exact mean cannot be obtained analytically. We
see that the accuracy of the sample mean and the precision of the confidence
interval improve as the number of samples, M , increases. In fact, we can see
directly from the definition (16.10) that the width of the confidence interval
scales with M like 1/
√
M; so, to obtain one more decimal place of accuracy we
need to do 100 times more computation. For this reason, Monte Carlo simulation
is impractical when very high accuracy is required.
3
More precisely, the Strong L aw of Large Numbers and the Central Limit Theo-
rem.
4
There is a well-defined sense in which this version of the sample variance is
improved if we multiply it by the factor M/(M −1). However, a justification for this
is beyond the scope of the book, and the effect is negligible when M is large.