Skip to content

starsimhub/crn_paper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Taming Randomness in Agent-Based Models using Common Random Numbers

This code is released in support of the above manuscript, which is currently under review. The full citation will be added upon acceptance.

Structure

All code used to generate model-based results is in this repository. The structure is as follows:

  • The Python library code is in crn_paper, including disease-specific modules like hiv.py, PPH_demographics.py, and utilities like analyzers.py.
  • Script files used to run and process the simulations are in scripts. The main files are:
  • PPH: run_PPH.py
  • SIR: run_SIR.py
  • VMMC: run_VMMC.py
  • pairwise_bias.py was used to evaluate potential bias in pairwise random numbers, resulting in Appendix A.
  • net_perf.py was used to evaluate the performance of several networks, resulting in the figure in Appendix C.

Other scripts are included for completeness. These scripts are computationally intensive, requiring roughly 3 hours on a laptop.

The result of running each script is a corresponding folder of results and figures that will appear within the figs folder.

The pre-generated data files loaded by the scripts are stored in figs, from which figures can be generated by passing -p as a command line argument to each corresponding script.

Installation

  1. Ensure you have Python installed (if you haven't installed Python already, the easiest is to use Anaconda; an out-of-the-box system Python installation is unlikely to work).

  2. In a terminal (or Windows command prompt), type pip install -e . to install (note the "." at the end of the command, this is critical!).

  3. To test your installation, import crn_paper should work from a Python prompt.

If you're using R, you need to have R installed. You also need to install reticulate (which allows R to communicate with Python): install.packages("reticulate"). Note: Even if you're using R, you still need to follow the first two steps to install the Python package.

Usage

The code is provided on an as-is basis and there may be practical challenges in getting it to run on a particular system (see note about compute requirements above). However, it should at least be possible to regenerate the figures by running the scripts.

Disclaimer

The code in this repository was developed by researchers at IDM and the Burnet Institute. We've made it publicly available under the MIT License to provide others with a better understanding of our research and an opportunity to build upon it for their own work. We make no representations that the code works as intended or that we will provide support, address issues that are found, or accept pull requests. You are welcome to create your own fork and modify the code to suit your own modeling needs as permitted under the MIT License.

About

Scripts to generate results for the common random numbers paper

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages