Concept Architecture
Concept
Theoretically, Random Number Generation is the process of producing numerical values that are statistically consistent with random sampling for use in stochastic computation. In health economic modelling, random number generation provides the mechanism by which uncertain events, parameter values and patient pathways are sampled during simulation. Most computational applications employ pseudo-random number generators, which use deterministic algorithms to produce sequences that approximate the statistical properties of independent random numbers while remaining reproducible through an initial seed value.
Mathematically, Random Number Generation is based on algorithms that generate sequences of values approximating independent observations from a uniform distribution on the interval (0,1). These uniform variates are subsequently transformed into samples from other probability distributions using recognised sampling methods such as inverse transform sampling or acceptance-rejection sampling. There is no universally recognised canonical mathematical formula because the implementation depends on the chosen random number generation algorithm.
In practice, Random Number Generation is implemented automatically within statistical software, spreadsheet applications and decision modelling platforms. Generated values are used to simulate state transitions, event occurrence, survival times, costs, utilities and treatment effects. High-quality random number generation is essential to ensure unbiased simulation results, numerical stability and reproducibility of health economic analyses.
Purpose
Used to generate stochastic samples from probability distributions for Monte Carlo simulation, microsimulation, probabilistic sensitivity analysis and other simulation-based methods in health economic evaluation.
Mathematical Formulae
Primary Formula
There is no universally recognised canonical mathematical formula.
Supporting Formulae
Linear congruential generator (classical algorithm):
X??? = (aX? + c) mod m
U? = X? / m
where:
- X? is the internal generator state
- a is the multiplier
- c is the increment
- m is the modulus
- U? is the generated uniform random variate.
Inverse transform sampling:
X = F??(U)
where:
- U ? U(0,1)
- F?? is the inverse cumulative distribution function of the target distribution.
Related Mathematical Methods
- Pseudo-random number generation
- Mersenne Twister
- Linear congruential generators
- Inverse transform sampling
- Acceptance-rejection sampling
- Monte Carlo simulation
- Probabilistic sensitivity analysis
Example
A probabilistic sensitivity analysis requires annual hospital costs to be sampled from a gamma distribution. A random number generator produces a sequence of independent uniform variates:
0.214, 0.781, 0.459, 0.932, ?
Each value is transformed using the inverse gamma cumulative distribution function to generate one simulated cost. After 10,000 iterations, the resulting distribution is used to estimate expected costs and the probability that an intervention is cost effective.
Excel Implementation
| Function | Example Formula | Health Economics Application |
|---|---|---|
| RAND | =RAND() | Generate uniform random numbers for stochastic simulation. |
| RANDARRAY | =RANDARRAY(10000,1) | Generate multiple random samples for Monte Carlo analysis. |
| NORM.INV | =NORM.INV(RAND(),Mean,SD) | Sample normally distributed clinical parameters. |
| BETA.INV | =BETA.INV(RAND(),Alpha,Beta) | Sample probabilities or utility weights. |
| GAMMA.INV | =GAMMA.INV(RAND(),Shape,Scale) | Sample positively skewed healthcare costs. |
VBA (Optional)
Automate repeated simulation runs by generating reproducible random samples for stochastic health economic models using a specified seed value.
Sources
- Briggs A, Claxton K, Sculpher M. Decision Modelling for Health Economic Evaluation. Oxford University Press; 2006.
- Robert CP, Casella G. Monte Carlo Statistical Methods. 2nd ed. Springer; 2004.
- Gentle JE. Random Number Generation and Monte Carlo Methods. 2nd ed. Springer; 2003.
- ISPOR-SMDM Modeling Good Research Practices Task Force. Modeling Good Research Practices. Value in Health. 2012.
- National Institute for Health and Care Excellence (NICE). Health Technology Evaluation Manual. Latest edition.
Related Concepts (2)
Library
Publications
1
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.
Journal ArticleView source →
Frequently Asked Questions (6)
What is random number generation?
The computational process of producing a sequence of numbers approximating true randomness, used to sample parameter values in probabilistic health economic models.
Source: Press et al. 2007
How does random number generation drive sampling in a model?
Every random draw a model makes, whether a patient's characteristic in a simulation or a parameter value in a probabilistic analysis, starts from a stream of numbers produced by a random number generator. These raw numbers, spread evenly between zero and one, are transformed to follow whichever distribution a quantity is meant to have, so the generator is the source from which all the model's randomness flows. Its behaviour therefore underlies every sampled result. Press and colleagues (2007) describe this mechanism.
Source: Press et al. 2007
How does random number generation work?
Random number generation typically uses a deterministic algorithm that, from a starting value, produces a long sequence of numbers appearing uniformly distributed and independent. These uniform random numbers are then transformed to follow whatever distributions are required, such as normal or beta, so that sampled parameter values have the intended distribution. The algorithm is chosen to have good statistical properties and a long period, so the generated numbers adequately mimic randomness for the simulation.
Source: Press et al. 2007
Why is random number generation important in health economic modelling?
Random number generation is important because probabilistic health economic models rely on sampling parameter values from distributions to represent uncertainty, and this sampling requires random numbers. In probabilistic sensitivity analysis, each iteration draws parameter values using generated random numbers, and the model is run many times to build a distribution of results. Without reliable random number generation, such analyses could not be performed, so it is a basic computational tool underpinning the handling of uncertainty in modelling.
Source: Briggs, Claxton & Sculpher 2006
How does random number generation support probabilistic sensitivity analysis?
In probabilistic sensitivity analysis, random number generation provides the draws that sample each uncertain parameter from its assigned distribution in every iteration, so that the model can be run repeatedly with different sampled inputs. The resulting distribution of costs and effects reflects the combined parameter uncertainty. Reliable generation, transforming uniform random numbers into the required distributions, ensures the samples are representative, so the analysis correctly propagates uncertainty to the cost-effectiveness results and supports outputs such as acceptability curves.
Source: Briggs, Claxton & Sculpher 2006
What ensures the quality of random number generation?
The quality of random number generation depends on the generator having good statistical properties, producing numbers that are uniformly distributed, independent, and free of detectable patterns, and a long period before repeating. Poor generators can introduce correlations that bias simulations, so well-tested algorithms are used. The transformation of uniform numbers into required distributions must also be correct. Ensuring these properties matters because large simulations draw many numbers, and defects would distort the sampled inputs and hence the results.
Source: Metropolis & Ulam 1949
Trust Record
Verified by Dr Darrin Baines
British health economist
Professional identity: darrinbaines.org
Verification date: 8 Oct 2025
Content version: 1.0.0
Canonical Identity
- Term code
- HE-EM-MS-008
Stable URI · Machine-readable · Resolvable · CC BY 4.0