Assessing the relationship between computational speed and precision: a case study comparing an interpreted versus compiled programming language using a stochastic simulation model in diabetes care.
BACKGROUND
Simulation techniques are well suited to modelling diseases yet can be computationally intensive. This study explores the relationship between modelled effect size, statistical precision, and efficiency gains achieved using variance reduction and an executable programming language.


METHODS
A published simulation model designed to model a population with type 2 diabetes mellitus based on the UKPDS 68 outcomes equations was coded in both Visual Basic for Applications (VBA) and C++. Efficiency gains due to the programming language were evaluated, as was the impact of antithetic variates to reduce variance, using predicted QALYs over a 40-year time horizon.


RESULTS
The use of C++ provided a 75- and 90-fold reduction in simulation run time when using mean and sampled input values, respectively. For a series of 50 one-way sensitivity analyses, this would yield a total run time of 2 minutes when using C++, compared with 155 minutes for VBA when using mean input values. The use of antithetic variates typically resulted in a 53% reduction in the number of simulation replications and run time required. When drawing all input values to the model from distributions, the use of C++ and variance reduction resulted in a 246-fold improvement in computation time compared with VBA - for which the evaluation of 50 scenarios would correspondingly require 3.8 hours (C++) and approximately 14.5 days (VBA).


CONCLUSIONS
The choice of programming language used in an economic model, as well as the methods for improving precision of model output can have profound effects on computation time. When constructing complex models, more computationally efficient approaches such as C++ and variance reduction should be considered; concerns regarding model transparency using compiled languages are best addressed via thorough documentation and model validation.
Cardiff Research Consortium Ltd, Cardiff, UK.
Phil
P
McEwan
Klas
K
Bergenheim
Yong
Y
Yuan
Anthony P
AP
Tetlow
Jason P
JP
Gordon
D003198:Computer Simulation; D016248:Computer Storage Devices; D003924:Diabetes Mellitus, Type 2 / Q000628:therapy*; D017850:Economics, Pharmaceutical; D017048:Health Care Costs; D006801:Humans; D018803:Models, Economic; D011381:Programming Languages; D012984:Software; D013269:Stochastic Processes