Skip to main content

Orstein-Uhlenbeck pandemic simulation

Project description


An agent model in which commuting, compliance, testing and contagion parameters drive infection in a population of thousands of millions. Agents follow Ornstein-Uhlenbeck processes in the plane and collisions drive transmission. Results are stored at for further analysis, and can be retrieved by anyone.


Covered in this post with the followup here where possible improvements are also discussed and acknowledgements are made. See also the SwarmPrediction.Com list of articles. The author is not an epidemiologist. The model expresses no opinions on the health aspects of COVID-19. The model offers a novel motion model with some interesting analytic properties also discussed in the article referenced above and presented in a more technical working paper shared on Overleaf.

Basic Usage

pip install pandemic
>> from pandemic import run
>> run()

See also examples of library use and examples of using the public database of simulations generated by this model.

Other entry points.

  • pandemic.simulation.simulate is the main routine
  • pandemic.client offers an alternative in object oriented style


See pandemic/ for examples of extending the newer style to include data storage, lockdown and so forth.


Pandemic can be run in a docker container.

docker run xtellurian/pandemic

Crowd-sourced surrogate model

See for an explanation of a SETI-like project to crowd-source a surrogate model.

Basic elements of the model

Covered in detail in this article. As noted some analytical properties of special cases of the model are discussed in a working paper.


Opinions and issues are most welcome.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for pandemic, version 0.4.4
Filename, size File type Python version Upload date Hashes
Filename, size pandemic-0.4.4-py3-none-any.whl (21.5 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size pandemic-0.4.4.tar.gz (17.7 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page