What is stochastic simulation?

A simulation in which some inputs are random, so each run gives a different result and many runs are needed to see the range.

Stochastic simulation diagram example

Public diagram from the Machinations Community. Open it on its own page

Stochastic simulation is a way of modeling a system in which some events or values are random, drawn from probability distributions. Each run produces one possible history, not a single answer. It matters because real systems contain variation, and averages alone hide the risk of bad outcomes.

How it works

The modeler describes each uncertain input with a distribution, such as arrivals that average 10 per hour or a price that varies by 5 percent. During each run, the computer draws values from those distributions. Running the model hundreds or thousands of times produces a set of outcomes that can be summarized by the mean, the spread, and percentiles, such as the 5th and 95th. This approach includes Monte Carlo simulation.

Stochastic results should not be judged from one run. The number of runs needed depends on the spread, and results stabilize slowly. A deterministic model, with no randomness, gives the same result each time and can miss effects such as queues that build up when arrivals bunch together. Stochastic methods are common in discrete-event simulation and agent-based modeling. See also probability distribution and variance.

Example

Say a shop receives on average 10 customers an hour, but the actual number varies from 6 to 14. It can serve 11 per hour. A deterministic model says the shop is fine, since 10 is below 11. A stochastic model shows that in about 3 of every 10 hours, arrivals exceed 11 and a queue forms, and on bad days waiting reaches 20 minutes. Averages hid this. This is an illustration with round numbers.

How to model it in Machinations

Add dice to a Source or a Gate, for example arrivals set to a random number between 6 and 14. Play once to see one possible history, then run a Forecast, which runs many Plays and shows the range of the chart. Use a Lever to change capacity and compare the ranges.

See stochastic simulation in a system you can Play

Build the rules in a Machinations diagram, change a value and Play it to watch how the system responds.