### Data for "Efficient Bayesian inference of fully stochastic epidemiological models with applications to COVID-19." #### Yuting I. Li et al., [Roy. Soc. Open Sci. 8, 211065 (2021)](https://doi.org/10.1098/rsos.211065). see also the preprint [arXiv:2010.11783](https://arxiv.org/abs/2010.11783) and [github data repo](https://github.com/rljack2002/infExampleCovidEW) ### Overview This repository contains python code (scripts and jupyter notebooks) for generation and processing of the results of the paper. Results are obtained using the [PyRoss](https://github.com/rajeshrinet/pyross) library to analyse an epidemiological compartment model for COVID-19 in England and Wales, during March-May 2020. Running the code requires `PyRoss`, see https://github.com/rajeshrinet/pyross ### Repo contents The folder `SimpleTestModel` contains a simple model to validate the inference methodology (see the README.md file in that directory) Other folders are elevant for the model for COVID-19 in England/Wales (the names indicate the sources used for *contact matrices*) #### Figures are in the folder `finalFigs/`, they are generated by python scripts as detailed below #### other folders (subdirectories) are relevant for model variants * `fumanelli-step` : $`C^F`$ variant, step-like NPI * `prem-step` : $`C^P`$ variant * `mix-step` : $`C^M`$ variant * `fumanelli-ez` : $`C^F`$ variant, NPI-with-easing #### Notebooks In most cases, the notebook "code" is identical in each folder, the results are different because variant information is loaded from `expt_params_local.py`. The only small differences are for the MCMC analysis of the `-ez-` variant, when displaying MCMC traces. To understand PyRoss syntax, see the [ documentation](https://pyross.readthedocs.io/en/latest/) and [examples](https://github.com/rajeshrinet/pyross#examples) Notebooks that exist in every folder. * ew-inf.ipynb : parameter optimisation for MAP * ew-mcmc.ipynb : MCMC on posterior * ew-mcmcPost.ipynb : MCMC post-process * ew-evidence.ipynb : evidence computation Notebooks only for `fumanelli-step` and `fumanelli-ez` * ew-sample.ipynb : stochastic forecasts Notebooks only for `fumanelli-step` * ew-FIM.ipynb : Fisher information matrix Additional notebooks for `fumanelli-ez` * ew-tWinNN-inf.ipynb : inference : where NN=09,10,11 is (inference window length + 1) * ew-tWinNN-mcmc.ipynb : ditto for mcmc * ew-tWinNN-result_mcmc.ipynb : ditto for mcmc postprocess #### Data Data that exist in each folder * ewMod-inf.pik : inference result * ewMod-result_mcmc.pik : representative MCMC samples (note: the full set of MCMC samples (`ewMod-mcmc.pik`) is *not* provided here due to very large file sizes, but `ewMod-result_mcmc.pik` contains representative samples) Data only for `fumanelli-step` and `fumanelli-ez` * ewMod-sample-post.pik : stochastic forecast (posterior sampled params) * ewMod-sample-map.pik : stochastic forecast (MAP params) Data only for `fumanelli-step` * ewMod-FIM.npy : Fisher information matrix (as numpy array) * ewMod-FIM-evec.pik : spectrum of FIM Figures are generated by python scripts (these also use PyRoss to run deterministic forecasts, etc, they should be run direct from the directories where they live) * `fumanelli-step/stepFigs.py` : graphs for step-like NPIs and for model comparison * `fumanelli-ez/easeFigs.py` : graphs for NPI-with-easing * `fumanelli-ez/genFigs.py` : general figs, NPIs, contact matrices, etc