4.3 How Many Simulated Values?

There are many topics to be described in the study of simulation (and fortunately many good sources to help you). The best way to appreciate simulation is to experience it. One topic that inevitably comes up is the number of simulated trials needed to rid yourself of sampling variability so that you may focus on patterns of interest.

How many simulated values are recommended? 100? 1,000,000? We can use the central limit theorem to respond to this question. Suppose that we wish to use simulation to calculate (mathrm{E~}h(X)), where (h(cdot)) is some known function. Then, based on (R) simulations (replications), we get ( X_1,ldots,X_R). From this simulated sample, we calculate a sample average
begin{eqnarray}
overline{h}_R=frac{1}{R}sum_{i=1}^{R} h(X_i)
end{eqnarray}
and a sample standard deviation
begin{eqnarray}
s_{h,R}^2 = frac{1}{R} sum_{i=1}^{R}left( h(X_i) -overline{h}_R
right) ^2.
end{eqnarray}
So, (overline{h}_R) is your best estimate of (mathrm{E~}h(X)) and (s_{h,R}^2) provides an indication of the uncertainty of your estimate.
As one criterion for your confidence in the result, suppose that you wish to be within 1% of the mean with 95% certainty. According to the central limit theorem, your estimate should be approximately normally distributed. Thus, you should continue your simulation until
begin{eqnarray}
frac{.01overline{h}_R}{s_{h,R}/sqrt{R}}geq 1.96
end{eqnarray}
or equivalently
begin{eqnarray}
R geq 38,416frac{s_{h,R}^2}{overline{h}_R^2}.
end{eqnarray}
This criterion is a direct application of the approximate normality (recall that 1.96 is the 97.5th percentile of the standard normal curve). Note that (overline{h}_R) and (s_{h,R}) are not known in advance, so you will have to come up with estimates as you go (sequentially), either by doing a little pilot study in advance or by interrupting your procedure intermittently to see if the criterion is satisfied.

[raw] [/raw]