Skip to content

Code for Paper Contact network structure shaped pandemic transmission despite lockdowns

License

Notifications You must be signed in to change notification settings

MLGlobalHealth/covimod-scale-free

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

covimod-scale-free

This repository contains the code and data for the paper "Contact network structure shaped pandemic transmission despite lockdowns" by Zhi L. et al. (2026). The paper is available at https://www.medrxiv.org/content/10.64898/2026.02.06.26345745v1.

Installation

We use conda and python.

conda create -n proj python=3.11
conda activate proj
pip install -r requirements.txt

We require the CmdStan installation. This can be done via python. For other installation methods, see the documentation.

from cmdstanpy import cmdstan_path, set_cmdstan_path, install_cmdstan
install_cmdstan(version="2.35.0", verbose=True, progress=True, cores=4)
cmdstan_path()

For better computational performance, we use GPU with Stan.

Ensure that NVIDIA GPU drivers are correctly installed

nvidia-smi

Ensure that CUDA Toolkit are correctly installed and is accessible via PATH

nvcc --version
echo $CUDA_HOME

Data

The data are not publicly available but can be obtained from the corresponding authors upon reasonable request.

Reproduce the analysis

git clone https://github.com/MLGlobalHealth/covimod-scale-free.git
cd covimod-scale-free

Main model

The main Stan model is under model/bnb. Run the model by:

python model/bnb_r30_bg.py

After the run finishes, a subfolder will be created under model/bnb, containing posterior samples, diagnostics, plots, and logs.

Variable selection

Documentation WIP...

Epidemic simulation

Documentation WIP...

About

Code for Paper Contact network structure shaped pandemic transmission despite lockdowns

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •