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.

Xˉ\bar X is a mean across n independent outcomes and σ is their model SD; its mean's SD is σ divided by sqrt(n).

Outcome spread stays; mean error shrinks
Individual outcome · SD 20Mean of 400 · SD 16080100120140Outcome units
Individual outcome · SD 20Mean of 400 · SD 16080100120140Outcome units
SD(Xˉ)=σ/n\mathrm{SD}(\bar X)=\sigma/\sqrt n
Reference illustration. Reference normal model with mean 100 and SD 20. The long line is ±1 SD for an individual outcome; the short line is ±1 sampling SD of a mean of 400 independent outcomes. Neither is a 95% interval.

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.

Tools
About Python ↗

The code is editable. Press Ctrl+Enter or ⌘+Enter to run Python from the editor.

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?

Back to the Python editor

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?

Choose an answer
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.

Your notes