Package: pySODM
pySODMSimulating and Optimising Dynamical Models in Python 3Quick installationpip install pySODMResourcesDocumentation:https://twallema.github.io/pySODMManuscript:https://www.sciencedirect.com/science/article/pii/S1877750323002089pyPI:https://pypi.org/project/pySODM/Aim & ScopeA modeling and simulation workflow will typically constitute the following steps (seeVillaverde et. al),Build a system dynamical model to describe some real-world phenomenon. Assess structural identifiability.Calibrate the model to a set of experimental data.Extract knowledge from the calibrated parameter values (assess practical identifiability).Use the model to make projections outside the calibrated range.The aim of pySODM is to reduce the time it takes to step through this workflow. pySODM provides atemplateto construct, simulate and calibrate dynamical systems governed by differential equations. Models can have n-dimensional labeled states of different sizes and can be simulated deterministically and stochastically. Model parameters can be time-dependent by means of complex functions
with arbitrary inputs. The labeled n-dimensional model states can be aligned with n-dimensional
data to compute the posterior probability function, which can subsequently be optimised.Overview of featuresWorkflowFeaturesConstruct a dynamical modelImplement coupled systems of differential equationsStates can be n-dimensional and of different sizes, allowing users to build models with subprocessesAllows n-dimensional model states to be labelled with coordinates and dimensions by usingxarray.Dataset}to store simulation outputEasy indexing, manipulating, saving, and piping to third-party software of model output by formatting simulation output asxarray.DatasetSimulating the modelContinuous and discrete deterministic simulation or discrete stochastic simulation (Jump processes, Gillespie's Stochastic Simulation Algorithm or Tau-Leaping)Vary model parameters during the simulation generically using a complex functionUsedraw functionsto perform repeated simulations for sensitivity analysis. With multiprocessing supportCalibrate the modelConstruct and maximize a posterior probability functionAutomatic alignment of data and model forecast over timesteps and coordinatesNelder-Mead Simplex and Particle Swarm Optimization for point estimation of model parametersPipeline to and backend foremcee.EnsembleSamplerto perform Bayesian inference of model parametersGetting startedThequistart tutorialwill teach you the basics of building and simulating models with n-dimensional labeled states in pySODM. It will demonstrate how to vary model parameters over the course of a simulation and how to perform repeated simulations with sampling of model parameters.Theworkflowtutorial provides a step-by-step introduction to a modeling and simulation workflow by inferring the distributions of the model parameters of a simple compartmental disease model using a synthetic dataset.Theenzyme kineticsandinfluenza 17-18case studies apply the modeling and simulation workflow to more advanced, real-world problems. In the enzyme kinetics case study, a 1D packed-bed reactor model is implemented in pySODM by reducing the two PDEs to a set of coupled ODEs by using the method-of-lines. In the Influenza 17-18 case study, a stochastic, age-structured model for influenza is developped and calibrated to the Influenza incidence data reported by the Belgian Federal Institute of Public Health. These case studies mainly serve to demonstrate pySODM's capabilities across scientific disciplines and highlight the arbitrarily complex nature of the models that can be built with pySODM. For an academic description of pySODM and on the Enzyme Kinetics and Influenza 17-18 case studies, checkout ourmanuscript.VersionsVersion 0.2.0 (2023-01-19, PR #25)Introduction ofdimensions_per_statein model declaration, allowing the user to define models where states can have different sizes.Version 0.2.1 (2023-01-27, PR #30)Fixed bugs encountered when incorporating pySODM into the SARS-CoV-2 Dynamic Transmission Models. More thorough checks onboundsin the log posterior probability function. Finished manuscript.Version 0.2.2 (2023-01-27, PR #31)Published to pyPI.Version 0.2.3 (2023-05-04, PR #46)Fixed minor bugs encountered when using pySODM for a dynamic input-output model of the Belgian economy. Published to pyPI.Version 0.2.4 (2023-12-04, PR #62)Validated the use of Python 3.11. Efficiency gains in simulation of jump processes. Ommitted dependency on Numba. All changes related to publishing our software manuscript in Journal of Computational Science. Improved nomenclature in model defenition.Version 0.1 (2022-12-23, PR #14)Application pySODM to three use cases. Documentation website. Unit tests for ODE, JumpProcess and calibration.Version 0.1.1 (2023-01-09, PR #20)Start of semantic versions: Major.Minor.PatchVersion 0.1.2 (2023-01-11, PR #23)Calibration of 1-D model parameters generalized to n-dimensions.
Added 'aggregation functions' to thelog_posterior_probabilityclass to perform custom aggregations of model output before matching with data.xarray.DataArray/xarray.Datasetcan be used as datasets during calibration. Internally converted topd.DataFrame.Version 0.0 (2022-11-14)First pySODM version. Obtained by splitting the generally applicable parts from the ad-hoc parts in UGentBiomath/COVID19-Model. Without documentation website.Pre-development (2020-05-01 - 2022-11-24)Code developped to model the spread of SARS-CoV-2 in Belgium (UGentBiomath/COVID19-Model).