Understand simulation errorLesson 13 of 76 · 7 min
Two different kinds of spread
Distinguish variation in outcomes from Monte Carlo error in an estimated mean.
Individual outcomes can remain highly variable even when their mean is estimated precisely. Outcome spread describes the simulated world. Monte Carlo error describes how much the numerical estimate changes when you rerun a finite simulation of that same world.
Generate many independent batches from one fixed input distribution. Each batch has its own sample mean. The standard deviation within a batch describes outcomes; the spread across batch means describes variation in the estimator.
Increasing the number of draws per batch usually reduces the latter under independent finite-variance sampling. It does not make the modelled outcomes more predictable, remove input uncertainty or establish that the distribution is a good description of reality. Name which uncertainty a reported interval addresses.
is a mean across n independent outcomes and σ is their model SD; its mean's SD is σ divided by sqrt(n).
Will more simulation trials make individual delivery times less variable?
Write a prediction (optional)
Seeded teaching simulation
Select Run Python below with the code unchanged.
A saved draft is open. To run the published example, open Tools and select Restore example. Recover draft brings your code back.
Execution error
Technical error details
Your result
Published example output
This result comes from the original Python. Your runs appear above. Build environment ↗
Draws per batch: 25 average outcome SD: 20.1 SD of batch means: 3.587 Draws per batch: 400 average outcome SD: 19.99 SD of batch means: 0.951 Draws per batch: 6400 average outcome SD: 20.0 SD of batch means: 0.275
Read the first result
Each row reports average outcome SD inside batches and SD of batch means across batches. Read down those columns as the number of draws increases.
Try an edit
Replace rng.normal(100, 20, size=(100, n)) with rng.normal(100, 40, size=(100, n)). Select Run Python again. For the same Draws per batch, compare average outcome SD and SD of batch means before and after. How does doubling model spread differ from increasing draws per batch?
Scope. The batches here are independent normal draws with finite variance. Other sampling schemes need different error calculations.
Try a fresh case
A million runs give a very narrow interval for mean cost. What can still be large?
Need a hint?
Hint 1
Name what is repeated when you add simulation runs.
Hint 2
Ask whether any new real-world observations were collected.