EXPLORING PYTHON FOR USE IN MODELING- DECREASING RUN-TIMES FOR PROBABILISTIC SENSITIVITY ANALYSIS

Author(s)

Stokes ME1, Quon P2
1Evidera, St-Laurent, QC, Canada, 2Evidera, Bethesda, MD, USA

OBJECTIVES:  Python was released in 1991 as a general-purpose programming language. Its use for scientific computing in industry and academic research has increased significantly in recent years. We discuss using Python in health economic modelling and, in particular, the advantages associated with its powerful multidimensional array object through various practical examples including a probabilistic sensitivity analysis (PSA). METHODS:  A fictional model was explored comparing two drugs for prevention of moderate and severe manifestations of a hypothetical disease. The model and PSA were implemented in NumPy, a fundamental package which extends the Python core language for scientific computing. The algorithm stores data in a 3-dimensional (d) array with the first two axes corresponding to model health states and cycles, respectively. The third axis represents a unique simulation where input parameters are varied randomly according to appropriate probability distributions. The 3-d nature of the array allows for simultaneous calculation and storage of many different versions of the model. RESULTS:  In this fictional model with 5 disease states and 40 cycles, a PSA with 1,000 simulations in Python has a run-time of 50 milliseconds and 450 milliseconds for a PSA with 10,000 simulations. The PSA was much slower in Excel with run-times of approximately 45 seconds and 8 minutes for 1,000 and 10,000 simulations, respectively. CONCLUSIONS:  The implementation of the PSA using NumPy were many orders of magnitude faster compared to Excel. Faster execution, especially with complex models, improves the feasibility to explore many scenarios and test structural validity. There is recognition that the complexity of many diseases are not accurately captured in Excel cohort models; thus there is a shift towards more sophisticated modeling such as individual simulation. Coupled with the requirement for PSA, the adoption of software platforms that can manage computationally expensive algorithms will become increasingly more important.

Conference/Value in Health Info

2017-05, ISPOR 2017, Boston, MA, USA

Value in Health, Vol. 20, No. 5 (May 2017)

Code

PRM87

Topic

Methodological & Statistical Research

Topic Subcategory

Modeling and simulation

Disease

Multiple Diseases

Explore Related HEOR by Topic


Your browser is out-of-date

ISPOR recommends that you update your browser for more security, speed and the best experience on ispor.org. Update my browser now

×