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.
We use conda and python.
conda create -n proj python=3.11
conda activate proj
pip install -r requirements.txtWe 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-smiEnsure that CUDA Toolkit are correctly installed and is accessible via PATH
nvcc --version
echo $CUDA_HOMEThe data are not publicly available but can be obtained from the corresponding authors upon reasonable request.
git clone https://github.com/MLGlobalHealth/covimod-scale-free.git
cd covimod-scale-freeThe main Stan model is under model/bnb. Run the model by:
python model/bnb_r30_bg.pyAfter the run finishes, a subfolder will be created under model/bnb, containing posterior samples, diagnostics, plots, and logs.
Documentation WIP...
Documentation WIP...