Author-reviewedEvidence: highv1.0.0

Monte Carlo Simulation

Monte Carlo simulation uses repeated random sampling to show how uncertainty in model inputs produces uncertainty in model outputs.

Status
Published, version 1.0.0
Last reviewed
24 Sep 2026, by Dr Darrin Baines
Report a problem
Tell us if something is wrong or out of date

Concept Architecture

This page explains the simulation process, the mathematics behind its estimates, its role in health-economic modelling, and the checks needed for credible interpretation.

What Monte Carlo simulation does

Monte Carlo simulation evaluates a model many times using input values sampled from specified probability distributions. Each iteration represents one internally consistent realisation of uncertainty, and the collection of iterations approximates the resulting distribution of outcomes. The method is especially useful when an analytical solution is unavailable or when many uncertain inputs interact non-linearly.

Monte Carlo simulation can represent different sources of variation, which must not be conflated:

Source of variationWhat is sampledWhat it represents
Parameter uncertaintyModel parameters such as treatment effects, costs, and utilitiesUncertainty about the true values of quantities used in the model
Individual variabilityPatient characteristics, event times, or outcomesDifferences between otherwise comparable individuals
Stochastic process uncertaintyChance events within a simulated pathwayRandomness in whether and when events occur
Structural uncertaintyAlternative model structures or assumptionsUncertainty that usually requires explicit scenario or model-averaging methods rather than routine parameter sampling alone

How the simulation works

A simulation begins with a deterministic model, identifies which inputs are uncertain, and assigns defensible distributions to those inputs. It then samples a complete input set, evaluates the model, and stores the outputs before repeating the process. The iterations are summarised only after the model has been checked for logical and numerical validity.

  1. Define the model and outputs. Specify the decision problem, model structure, comparators, time horizon, and outcomes to be recorded.
  2. Characterise uncertainty. Assign probability distributions to uncertain inputs using appropriate evidence and preserve important dependencies between parameters.
  3. Generate a draw. Sample one value for every uncertain input, using joint sampling when inputs are correlated.
  4. Run the model. Evaluate the model with the sampled input set and store the resulting costs, health outcomes, and decision measures.
  5. Repeat the process. Generate enough independent or appropriately constructed draws for the estimates to stabilise.
  6. Summarise and diagnose the results. Calculate expected outcomes, uncertainty intervals, decision probabilities, and Monte Carlo error, then test convergence and reproducibility.

The mathematical basis

Let Yi=g(θi)Y_i=g(\boldsymbol{\theta}_i) be the model output from iteration ii, where θi\boldsymbol{\theta}_i is a sampled set of uncertain inputs and g(⋅)g(\cdot) is the model. For NN iterations, the Monte Carlo estimator of the expected output is the sample mean. Its accuracy depends on both the validity of the model and distributions and the finite number of simulated draws.

E⁡^[Y]=Yˉ=1N∑i=1NYi\widehat{\operatorname{E}}[Y]=\bar{Y}=\frac{1}{N}\sum_{i=1}^{N}Y_i

The empirical variance of the simulated output is:

sY2=1N−1∑i=1N(Yi−Yˉ)2s_Y^2=\frac{1}{N-1}\sum_{i=1}^{N}(Y_i-\bar{Y})^2

When iterations are independent, the estimated Monte Carlo standard error of the mean is:

MCSE⁡(Yˉ)=sYN\operatorname{MCSE}(\bar{Y})=\frac{s_Y}{\sqrt{N}}

The 1/N1/\sqrt{N} convergence rate means that reducing Monte Carlo standard error by half generally requires about four times as many independent iterations. This sampling error is created by the simulation itself and is distinct from the uncertainty in the model inputs that the simulation is intended to represent.

How it is used in health-economic evaluation

In probabilistic sensitivity analysis, a parameter vector θi\boldsymbol{\theta}_i is sampled and every comparator is evaluated using that same draw. This preserves the relationship between comparator outcomes and produces a joint distribution of incremental costs and effects. The results support cost-effectiveness planes, cost-effectiveness acceptability curves, expected net benefit, and value-of-information analysis.

For comparator jj at decision threshold λ\lambda, net monetary benefit in iteration ii is:

NMB⁡ij(λ)=λEij−Cij\operatorname{NMB}_{ij}(\lambda)=\lambda E_{ij}-C_{ij}

For an intervention compared with a reference option, incremental net monetary benefit is:

INMB⁡i(λ)=λΔEi−ΔCi\operatorname{INMB}_{i}(\lambda)=\lambda\Delta E_i-\Delta C_i

The simulated probability that the intervention is cost-effective at threshold λ\lambda is estimated directly from the proportion of iterations with positive incremental net monetary benefit:

Pr⁡^(cost-effective∣λ)=1N∑i=1NI ⁣[INMB⁡i(λ)>0]\widehat{\Pr}(\text{cost-effective}\mid\lambda)=\frac{1}{N}\sum_{i=1}^{N}\mathbb{I}\!\left[\operatorname{INMB}_{i}(\lambda)>0\right]

Here, EijE_{ij} and CijC_{ij} are the effectiveness and cost for comparator jj in iteration ii, ΔEi\Delta E_i and ΔCi\Delta C_i are incremental outcomes, and I[⋅]\mathbb{I}[\cdot] equals 1 when its condition is true and 0 otherwise. Decision uncertainty should be calculated from iteration-level joint results rather than inferred from a ratio of mean costs to mean effects.

Choosing distributions and dependencies

The distribution for an uncertain input should reflect its scale, bounds, evidence, and interpretation. Distribution choice is therefore a modelling judgment supported by data and clinical or methodological reasoning, not a formatting exercise. Correlations must be retained when parameters share evidence or when sampling them independently would generate implausible combinations.

Input typeCommon modelling optionImportant caution
Probability or utility bounded between 0 and 1Beta distributionValues at exactly 0 or 1 may require a different or adjusted specification.
Positive cost or resource useGamma or log-normal distributionThe distribution should reproduce the observed or assumed mean and variance.
Relative effect constrained above 0Log-normal distributionSampling is usually performed on the log scale to preserve positivity.
Unconstrained continuous parameterNormal distributionNormal sampling may be unsuitable when impossible tail values can occur.
Several mutually exclusive probabilitiesDirichlet distributionSeparate beta draws generally fail to preserve a total of 1.
Correlated parametersJoint or multivariate distributionMarginal distributions alone do not preserve covariance.

Worked health-economic example

Consider an illustrative probabilistic analysis comparing a new treatment with usual care. Each iteration uses paired sampled inputs for both comparators and produces incremental cost, incremental quality-adjusted life-years, and incremental net monetary benefit. Suppose 10,000 iterations give mean incremental cost of £2,150 and mean incremental effectiveness of 0.18 quality-adjusted life-years.

At a threshold of £20,000 per quality-adjusted life-year, the incremental net monetary benefit calculated from the mean outcomes is:

INMB⁡=(£20,000×0.18)−£2,150=£1,450\operatorname{INMB}=(£20{,}000\times0.18)-£2{,}150=£1{,}450

The corresponding ratio of mean incremental cost to mean incremental effectiveness is:

ICER⁡=£2,1500.18=£11,944 per quality-adjusted life-year\operatorname{ICER}=\frac{£2{,}150}{0.18}=£11{,}944\text{ per quality-adjusted life-year}

A positive expected incremental net monetary benefit favours the new treatment at this threshold. If 9,400 of the 10,000 iteration-level incremental net monetary benefits are positive, the estimated probability of cost-effectiveness is 94%; that probability describes decision uncertainty and does not mean the intervention is 94% effective. The example values are illustrative and should not be treated as evidence for a real technology.

Interpreting the outputs

Monte Carlo output is a simulated distribution conditional on the model, evidence, and assumptions. It can quantify the consequences of parameter uncertainty, but it cannot correct biased source data, an invalid model structure, omitted uncertainty, or inappropriate distributions. Interpretation should therefore connect numerical summaries to the decision question and the model's limitations.

  • Expected outcomes are the means of the simulated costs, effects, or net benefits for each comparator.
  • Uncertainty intervals describe the empirical spread of simulated quantities but should be labelled according to what was sampled and how the interval was constructed.
  • The cost-effectiveness plane displays the joint distribution of incremental costs and effects and preserves information lost in a single ratio.
  • The cost-effectiveness acceptability curve shows the proportion of simulations in which each comparator has the greatest net benefit across decision thresholds.
  • Expected value of perfect information measures the expected opportunity loss from making a decision with current uncertainty; it is not a confidence interval.

Checking convergence and reproducibility

A credible analysis demonstrates that the reported results are stable enough for their intended decision use. A fixed random-number seed supports exact reruns, while additional seeds or independently generated runs help show that conclusions are not artifacts of one random sequence. The required number of iterations depends on the precision needed for the specific output, not on a universal minimum.

  • Report the random-number generator, seed policy, software, model version, and number of iterations.
  • Plot cumulative estimates or evaluate results at increasing iteration counts to assess stability.
  • Calculate Monte Carlo standard errors for key means and decision probabilities where feasible.
  • Confirm that sampled values respect parameter bounds, correlations, and logical constraints.
  • Re-run the analysis with a larger sample when simulation noise could change the decision or materially alter a reported probability.
  • Separate first-order patient-level variability from second-order parameter uncertainty when the model uses nested simulation.

Practical implementation

Implementation should preserve one row or record per iteration and retain sampled inputs alongside the resulting outputs. This structure allows analysts to diagnose implausible draws, reproduce summaries, and calculate decision measures without repeatedly rerunning the model. Vectorised code, suitable simulation software, or carefully controlled spreadsheet automation is generally preferable to opaque manual recalculation.

Set the random-number seed
For iteration i = 1 to N:
    Sample the correlated parameter vector theta[i]
    Evaluate every comparator using theta[i]
    Store costs, effects, and net benefits
Summarise iteration-level outputs
Calculate Monte Carlo error and test convergence

In a spreadsheet, functions such as RAND(), NORM.INV(), BETA.INV(), and GAMMA.INV() can generate draws, while AVERAGE() and STDEV.S() can summarise outputs. Because volatile spreadsheet functions change whenever the workbook recalculates, a validated production workflow should control seeds or preserve the sampled draws and record the workbook version.

Common mistakes and limitations

Monte Carlo simulation is computationally flexible, but its outputs remain conditional on modelling choices. More iterations reduce simulation noise but do not reduce bias from poor evidence or repair a misspecified model. Analysts should therefore distinguish computational precision from evidential credibility.

  • Sampling every parameter independently can destroy real correlations and understate or overstate uncertainty.
  • Using distributions because they are convenient rather than because they match the parameter can generate impossible or misleading values.
  • Mixing patient variability with parameter uncertainty can make probabilistic sensitivity analysis difficult to interpret.
  • Reporting only a mean or an incremental cost-effectiveness ratio conceals the joint distribution of outcomes.
  • Treating the proportion of cost-effective iterations as the probability that the model or intervention is correct overstates what the simulation establishes.
  • Increasing the number of iterations cannot account for excluded structural assumptions, missing comparators, or biased evidence.

Library

Publications

3
  • Journal article

    Microsimulation Modeling for Health Decision Sciences Using R: A Tutorial — Krijkamp, Alarid-Escudero, Enns, Jalal, Hunink & Pechlivanoglou, Vol. 38, No. 3 ed., 2018 (Medical Decision Making)

    The DARTH workgroup’s tutorial on implementing individual-level (microsimulation) models in R, including vectorisation techniques that dramatically reduce run time — the standard reference for patient-level simulation in R.

  • Book

    Markov Chain Monte Carlo in Practice — W. R. Gilks, S. Richardson & D. J. Spiegelhalter (editors), 1st Edition ed., 1996 (Chapman & Hall)

    A foundational collection on Markov chain Monte Carlo methodology and practice, linking stochastic simulation with Bayesian inference and Gibbs sampling.

  • Book

    The BUGS Book: A Practical Introduction to Bayesian Analysis — David Lunn, Chris Jackson, Nicky Best, Andrew Thomas & David Spiegelhalter, 1st Edition ed., 2012 (Chapman & Hall / CRC Press)

    A practical guide to Bayesian modeling with BUGS, covering prior specification, posterior simulation, model checking and Markov chain Monte Carlo computation.

Frequently Asked Questions (6)

  • What is Monte Carlo simulation?

    A technique estimating a model's output under uncertainty by repeatedly sampling random values for its inputs from specified distributions across many iterations.

    Source: Metropolis & Ulam 1949

  • Where does the name Monte Carlo simulation come from?

    The method is named after the casino district of Monaco, a nod to the games of chance whose randomness it imitates. It was developed by physicists in the 1940s, among them Stanislaw Ulam and John von Neumann, who used repeated random sampling to solve problems too complex for direct calculation. Drawing many random values and averaging the results lets the method estimate quantities that resist exact solution. The gambling allusion captures its reliance on chance. Metropolis and Ulam (1949) introduced the approach.

    Source: Metropolis & Ulam 1949

  • How does Monte Carlo simulation work?

    Monte Carlo simulation works by specifying probability distributions for the uncertain inputs, then repeatedly drawing a random value for each input from its distribution, running the model with those values, and recording the output, over many iterations. The collection of outputs forms a distribution reflecting the combined effect of the input uncertainty. Summarising this distribution, by its mean, spread, or probabilities, gives the estimate and its uncertainty. Many iterations are used so the sampled distribution stabilises and approximates the true output distribution.

    Source: Metropolis & Ulam 1949

  • Why is Monte Carlo simulation used?

    Monte Carlo simulation is used to propagate uncertainty through a model, showing how uncertainty in the inputs translates into uncertainty in the output, which is often impossible to derive analytically for complex models. It is central to probabilistic sensitivity analysis in health economics, where parameter distributions are sampled to estimate the uncertainty in cost-effectiveness results. It is also used to approximate integrals and expectations that cannot be computed directly. Its generality makes it a standard tool for handling uncertainty and complex calculations.

    Source: Metropolis & Ulam 1949

  • How is Monte Carlo simulation used in health economics?

    In health economics, Monte Carlo simulation underlies probabilistic sensitivity analysis: distributions are assigned to the uncertain parameters of a cost-effectiveness model, and the model is run many times with parameters sampled from these distributions, producing a distribution of costs and effects. This shows the uncertainty in the results, supporting outputs such as the cost-effectiveness plane and acceptability curve and the probability that an option is cost-effective. It is also used in individual simulation to sample patient events, so it is a core computational tool in the field.

    Source: Metropolis & Ulam 1949

  • What determines the accuracy of Monte Carlo simulation?

    The accuracy of Monte Carlo simulation depends chiefly on the number of iterations, since the estimates are based on sampled values and their precision improves as more samples are drawn, with the sampling error decreasing as the number of iterations rises. It also depends on the inputs being sampled from appropriate distributions. Enough iterations must be run for the results to stabilise, so that the Monte Carlo error is small relative to the quantities of interest, which is checked by whether results settle as iterations increase.

    Source: Metropolis & Ulam 1949

Trust Record

Verified by Dr Darrin Baines

British health economist

Professional identity: darrinbaines.org

Verification date: 24 Sep 2026

Content version: 1.0.0

Canonical Identity

Term code
HE-EM-MS-005
Wikidata
Q232207

Stable URI · Machine-readable · Resolvable · CC BY 4.0