• Stars
    star
    944
  • Rank 47,173 (Top 1.0 %)
  • Language Stan
  • License
    MIT License
  • Created about 4 years ago
  • Updated about 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Code for modelling estimated deaths and cases for COVID19.

covid19model DOI

Code for modelling estimated deaths and infections for COVID-19 from "Estimating the effects of non-pharmaceutical interventions on COVID-19 in Europe", Flaxman, Mishra, Gandy et al, Nature, 2020, the published version of our original Report 13.

If you are looking for the individual based model used in Imperial's Report 9, Ferguson, Laydon, Nedjati-Gilani et al, please look here.

Version 12 Release DOI

This is the release related to our Tiers paper, where we use latent factor model to estimate the effectiveness of tiers systems in England. Peer reviewed version to be out soon. All other code is still the same for previous releases.

To reproduce results of the paper either from Rstudio source("tiers/spline_LFA.R") or from the command line Rscript tiers/spline_LFA.R.

The instructions for reproducing European report , Italy report , Brazil report , USA report , Nature, IFR, USA age specific report, Nature Communincations, and Science paper are the same as earlier (Look at version 3, version 4, version 5, version 6, version 7, version 8, version 9, version 10 and version 11). This release is specific to Tiers paper.

This release has been checked on macOS Catalina version 10.15.6/7 and Ubuntu version 18.04.2.

The authors of version 12 Release are Daniel J Laydon, Swapnil Mishra, and Samir Bhatt

Version 11 Release DOI

This is the release related to our Science paper, where we use age-specific mobility data to estimate the epidemic in the USA by accounting for age-specific heterogeneity. All other code is still the same for previous releases.

To run this code you need to follow the steps listed in the age-specific model here.

The code should be run in full mode to obtain credible results. Not running a full run to estimate anything is not recommended and discouraged. Only a full run should be used to get results.

The instructions for reproducing European report , Italy report , Brazil report , USA report , Nature, IFR, USA age specific report and Nature Communincations are the same as earlier (Look at version 3, version 4, version 5, version 6, version 7, version 8, version 9 and version 10). This release is specific to Science paper.

This release has been checked on macOS Catalina version 10.15.6/7 and Ubuntu version 18.04.2.

The authors of version 11 Release are Melodie Monod, Alexandra Blenkinsop, Xiaoyue Xi, H Juliette Unwin, Swapnil Mishra, Oliver Ratmann"

Version 10 Release DOI

This is the release related to Unwin, H.J.T., Mishra, S., Bradley, V.C. et al. State-level tracking of COVID-19 in the United States. Nat Commun 11, 6189 (2020). https://doi.org/10.1038/s41467-020-19652-6, where we use mobility data to estimate situation in all states of the USA. All other code is still the same.

To run this code you can directly run the base-usa.r file or from command line after seting the current directory as the repository directory run the following command Rscript base-usa-cases.r

The code should be run in full mode to obtain credible results. Not running a full run to estimate anything is not recommended and discouraged. Only a full run should be used to get results.

The instructions for European, Italy, Brazil, USA, Nature, IFR, USA age-specific code are the same as earlier (Look at version 3, version 4, version 5, version 6, version 7, version 8, and version 9). This release is specific to [ usa-paper (soon to be out) and medRxiv paper.

This release has been checked on macOS Catalina version 10.15.6/7 and Ubuntu version 18.04.2.

Version 9 Release DOI

This is the release related to report 32 and medRxiv paper, where we use age-specific mobility data to estimate the epidemic in the USA by accounting for age-specific heterogeneity. All other code is still the same for previous releases.

To run this code you need to follow the steps listed in the age-specific model here.

The code should be run in full mode to obtain credible results. Not running a full run to estimate anything is not recommended and discouraged. Only a full run should be used to get results.

The instructions for European, Italy, Brazil, USA, Nature, and IFR code are the same as earlier (Look at version 3, version 4, version 5, version 6, version 7, and version 8). This release is specific to report 32.

This release has been checked on macOS Catalina version 10.15.6/7 and Ubuntu version 18.04.2.

Version 8 Release DOI

The code for running models remains unchanged in the release. We provide scripts to calculate ifr for European countries and USA states. We hope the release of ifr computation code will enable the researchers to adapt the ifr calculations as per their requirements. The two files to run are compute-ifr-europe.r and compute-ifr-usa.r.

The code for ifr calculation for a new country will need changes if you have different age-specific bands. The code provided is not a universal code that will work for each country, the intention is to help researchers to modify the code easily for their setup.

The code for ifr needs an additional package named socialmixr, which is not specified in environment file as it doesn't exist with conda. You will need to download it via CRAN.

Version 7 Release DOI

This code is the exact code that was used in Flaxman, Mishra, Gandy et al. "Estimating the effects of non-pharmaceutical interventions on COVID-19 in Europe," Nature, 2020. https://www.nature.com/articles/s41586-020-2405-7

To run the code from the main folder in Rstudio source("base-nature.r") or from the command line Rscript base-nature.r.

The code should be run in full mode to obtain results---debug mode is only to check that your environment has the required libraries; results will not be reliable as the MCMC chains will not have converged.

The repository with posterior draws of the model in Flaxman, Mishra, Gandy et al. "Estimating the effects of non-pharmaceutical interventions on COVID-19 in Europe," Nature, 2020. https://www.nature.com/articles/s41586-020-2405-7 is here.

This code doesn't supersede our earlier model, it is here for everyone to have direct access to code used in Flaxman, Mishra, Gandy et al. "Estimating the effects of non-pharmaceutical interventions on COVID-19 in Europe," Nature, 2020.https://www.nature.com/articles/s41586-020-2405-7.

The instructions for European, Italy, Brazil, and USA code are the same as earlier (Look at version 3, version 4, version 5, version 6).

Version 6 Release

This is the release related to report 23, where we use mobility data to estimate situation in all states of the USA. All other code is still the same.

To run this code you can directly run the base-usa.r file or from command line after seting the current directory as the repository directory run the following command Rscript base-usa.r

The code should be run in full mode to obtain any results. Not running full model to estimate anything is not recommended and discouraged. Only full run should be used to get results.

The instructions for European, Italy and Brazil code are same as earlier (Look at version 3, version 4 and version 5). This release is specific to USA report.

This release has been checked on macOS Catalina version 10.15.6 and Ubuntu version 18.04.2. A full run takes about 20 hours using 4 cores.

Version 5 Release

This is the release related to report 21, where we use mobility data to estimate situation in Brazil. All other code is still the same.

To run this code you can directly run the base-Brazil.r file or from command line after seting the current directory as the repository directory run the following command Rscript base-Brazil.r

The code shold be run in full mode to obtain any results. Not running full model to estimate anything is not recommended and discouraged. Only full run should be used to get results.

The instructions for European and Italy code are same as earlier (Look at version 3 and version 4). This release is specific to Brazil report

Version 4 Release

This is the release related to report 20, where we use mobility data to estimate situation in Italy. All other code is still the same.

To run this code you can directly source the base-italy.r file in rstudio inside the project or from command line after setting the current directory as the repository directory run the following command Rscript base-italy.r base-italy google interventions '~ -1 + residential + transit + averageMobility' '~ -1 + residential + transit + averageMobility'

The code for scenarios runs only in full mode not in short run or debug mode. Not running full model to estimate anything is not recommended and discouraged. Only full run should be used to get results.

The instructions for European code are below. This release is specific to Italy report

Version 3 Release

In this update, we first extended our model from version 2 to have 'partial-pooling' for lockdown across all countries. This means now we have a global effect of lockdown along with each country having its own different lockdown effect. We also made our code modular, stan code faster (with help from the community) and now we create CSV outputs too for usage.

You can directly get csv files here and new model description here

Notice

โš ๏ธ Python code is right now not updated and won't work. Python code is good for only version 1 model and data.

โš ๏ธ base_general.r and base_general.stan, base_general_speed.stan and base_general_speed2.stan are now valid models for only version2

โš ๏ธ This code is released with no support. We try our best to look at issues and pull request but can't help people with setup most of the time. We have docker images and conda environment file to make it easy for you to get started with the setup, any other approach assumes user can handle their computing environments approriately.

โš ๏ธ This model is in active development and so parameter name and behaviours, and output file formats will change without notice.

โš ๏ธ As with any mathematical model, it is easy to misconfigure inputs and therefore get meaningless outputs. The development team only endorses outputs it has itself generated.

Version 2 Release

In this update we extend our original model to include (a) population saturation effects, (b) prior uncertainty on the infection fatality ratio and (c) a more balanced prior on intervention effects. We also (d) included another 3 countries (Greece, the Netherlands and Portugal). The updated technical detail is available here.

You can directly look at our results here

This repository has code for replication purposes. The bleeding edge code and advancements are done in a private repository. Ask report authors for any collaborations.

Contributing

We welcome all potential collaborators and contributors from the wider community. Please see contributing for more details.

Installing dependencies

Using Conda

An environment.yml file is provided and can be used to build a virtual environment containing all model dependencies. Create the environment using:

conda env create -f environment.yml

Then activate the environment for use:

conda activate covid19model

This does not include the packages required for plotting maps. The following packages are required:

library(ggplot2)
library(ggstance)
library(ggrepel)
library(cowplot)
library(geofacet)
library(broom)
library(maptools)
library(rgeos)
library(rgdal)
library(colorspace)
library(sf)
library(scales)
library(bayesplot)
library(matrixStats)
library(boot)
library(lubridate)

Using Docker

A Docker image providing all model dependencies is available. See docker/README.md for details of running the model with Docker.

Other

If you wish to install packages into your native R environment or with a system package manager please see environment.yml for a full list of dependencies.

How to run the code

There are two ways to run our code:-

  • Open the rstudio project covid19model.Rproj file in rstudio and run/source base.r file
  • To run from commandline please enter the cloned directory and type Rscript base.r base in terminal

Please note to not make you wait for long we have by default set run sampling to a short period. For proper estimates please run it in FULL mode either by setting the flag --full or the environment variable FULL=TRUE. This will run sampling for 4000 iterations with 2000 warmups and 4 chains. The run time for 14 countries using new faster code is around 50 mins/1hr for the version 3 code.

Run mode settings

Three different run modes are supported:

  • DEBUG which can either be enabled by setting the flag --debug when running the base.r file as such:
    • Rscript base.r base --debug or by setting the environment variable DEBUG to TRUE.
  • DEFAULT which will run if neither full nor debug are set. Please note that for proper estimates FULL should always be set.
  • FULL which must always be used if you want to obtain reliable results and can be enabled by setting the flag --full on the command line:
    • Rscript base.r base --full or by setting the environment variable FULL to TRUE.

Results

  • The results are stored in two folders results and figures.
  • Results have the stored stan fits and data used for plotting
  • Figures have the images with daily cases, daily death and Rt for all countries.

More Repositories

1

formalising-mathematics

Lean 3 material for Kevin Buzzard's 2021 TCC courrse on formalising mathematics. Lean 4 version available here: https://github.com/ImperialCollegeLondon/formalising-mathematics-2024
Lean
295
star
2

natural_number_game

Building the natural numbers in Lean 3. The original natural number game, now frozen. See README for Lean 4 information.
Lean
289
star
3

sap-voicebox

Speech Processing Toolbox for MATLAB
MATLAB
233
star
4

M40001_lean

Lean 3 material related to Imperial College's "Introduction to University Mathematics" course
Lean
155
star
5

sharpy

Simulation of High Aspect Ratio aeroplanes and wind turbines in Python: a nonlinear aeroelastic code
Python
118
star
6

formalising-mathematics-2022

Lean 3 material for Kevin Buzzard's Jan-Mar 2022 course on formalising mathematics. Lean 4 version available here: https://github.com/ImperialCollegeLondon/formalising-mathematics-2024
Lean
118
star
7

FLT

Ongoing Lean formalisation of the proof of Fermat's Last Theorem
TeX
114
star
8

django-drf-filepond

A Django app providing a server implemention for the Filepond file upload library
Python
102
star
9

real-number-game

A gamification of the theorems in MATH40002 Analysis 1
Lean
75
star
10

ICLOCS

Imperial College London Optimal Control Software (ICLOCS)
MATLAB
69
star
11

formalising-mathematics-2024

Formalising Mathematics; a course for undergraduate mathematicians. Ran between January and March 2024.
Lean
68
star
12

group-theory-game

Building group theory from scratch in Lean
Lean
57
star
13

M4P33

M4 algebraic geometry course in Lean
Lean
57
star
14

pnextract

Pore network extraction from micro-CT images of porous media
C++
53
star
15

formalising-mathematics-2023

repository for material for Jan-Mar 2023 course on formalising mathematics
Lean
48
star
16

epidemia

epidemia package
R
46
star
17

EventEMin

Event-based vision motion estimation
C++
37
star
18

Visual2

F# re-implementation of VisUAL educational ARM assembler and simulator.
F#
37
star
19

RCDS-comm-line

https://github.com/kmichali/GS_comm_line
Jupyter Notebook
35
star
20

pnflow

Classical network (extraction and) flow simulation
C
35
star
21

complex-number-game

The Complex Number Game. Make the complex numbers in Lean.
Lean
32
star
22

RCDS-profiling-and-optimisation-in-python

Jupyter Notebook
31
star
23

RCDS-object-oriented-python

Jupyter Notebook
27
star
24

xena-UROP-2018

A place to put our 2018 Xena project UROP thoughts and programs.
Lean
23
star
25

porefoam

Direct pore-scale simulation of single- and two-phase flow through confined media (alpha-release / experimental)
C
23
star
26

Example-Lean-Projects

Some examples of Lean projects, for undergraduate mathematicians.
Lean
22
star
27

RCDS-machine-learning-with-python

Getting started with scikit-learn for machine learning
Jupyter Notebook
22
star
28

EpiCollectplus

The next generation of EpiCollect, multiple forms, more fields and more control. We recommend using Apache 2.2 or later, PHP 5.3 or later and MySQL 5.5 or later.
PHP
22
star
29

RCDS-intro-to-containers

22
star
30

csml-reading-group

Computational statistics and machine learning reading group at Imperial College London (2019-2020)
SCSS
22
star
31

spear-tools

SPEAR Challenge scripts and tools.
Python
21
star
32

UVLM

Unsteady Vortex Lattice Method for Aeroelasticity in C++
C++
21
star
33

porescale

Shell
18
star
34

poreFoam-singlePhase

Direct single-phase flow simulation and pre/post-processing codes
C++
18
star
35

RCDS-intro-to-machine-learning

Imperial College London / Graduate School / Data Science / Introduction to Machine Learning
17
star
36

poetry_template

Poetry-based Python application template with automated testing, CI and docs
Python
17
star
37

RCDS-data-processing-with-python

Imperial College London / Graduate School / Data Science / Data Processing with Python Pandas
Jupyter Notebook
17
star
38

pyrealm

Development of the pyrealm package, providing an integrated toolbox for modelling plant productivity, growth and demography using Python.
Python
16
star
39

RCDS-introduction-to-fortran

An Introductory Fortran course delivered by the Imperial College London Graduate School.
Fortran
15
star
40

GUIs-for-RS

Workshop on Graphical User Interfaces for Research Software
15
star
41

ComputerVision2018-19

Computer Vision 2018-19
Jupyter Notebook
14
star
42

M1P1-lean

Material from M1P1, formalised in Lean
Lean
14
star
43

RCDS-numerical-computing-in-python-with-numpy-and-scipy

Jupyter Notebook
14
star
44

R2T2

Research References Tracking Tool
Python
14
star
45

WInc3D

Wind Farm Simulator
Fortran
14
star
46

multifluids_icferst

Fortran
13
star
47

m1fexplained_lean3

A Lean formalisation of parts of Martin Liebeck's "A concise introduction to pure mathematics"
Lean
13
star
48

sap-sh-doa-estimation

Direction of arrival estimation algorithms in the spherical harmonics domain
MATLAB
13
star
49

fractalgenetics

Analysis of the genomic architecture and functional role of myocardial trabeculae
MATLAB
13
star
50

RCDS-writing-theses-in-latex

TeX
12
star
51

lean-maths-examples

Some theorems presented to first and second year mathematics undergraduates, First and second year undergraduate level mathematics
Lean
12
star
52

RCDS-sampling-and-hypothesis-testing

Imperial College London / Graduate School / Data Science / Introduction to Sampling & Hypothesis Testing
HTML
12
star
53

RCDS-introduction-to-latex

TeX
11
star
54

RCDS-plotting-in-python-with-matplotlib

Jupyter Notebook
10
star
55

grad_school_software_engineering_course

Essential Software Engineering for Researchers
HTML
10
star
56

wsi

WSIMOD is a software for simulating water quality and quantity
Python
10
star
57

pytest_template_application

Python application template with automated QA and Docker image publishing
Python
10
star
58

M1F-explained

A computer formalisation of parts of Martin Liebeck's book "a concise introduction to pure mathematics"
Lean
10
star
59

Multiview-Motion-Estimation-for-3D-cardiac-motion-tracking

Python
10
star
60

diastolic_genetics

Analysis of the genetic and environmental predictors of diastolic heart function
R
9
star
61

RCDS-further-hypothesis-testing

Imperial College London / Graduate School / Data Science / Further Hypothesis Testing
HTML
9
star
62

ReCoDe-Euler-Maruyama

ReCoDe project to showcase an implementation of the Euler-Maruyama numerical method to solve Stochastic Differential Equations
Python
9
star
63

imperial_latex_templates

Official LaTeX templates employing the Imperial College London brand.
TeX
9
star
64

python-guis

Python
9
star
65

US-covid19-agespecific-mortality-data

Extract COVID-19 age-specific mortality counts in U.S states and metropolitan areas
HTML
9
star
66

diophantine

Solving Diophantine equations in Lean
Lean
8
star
67

RCDS-data-exploration

Imperial College London / Graduate School / Data Science / Data Exploration & Visualisation
8
star
68

DirectSearch.jl

Direct search methods for derivative-free optimization
Julia
8
star
69

RCDS-managing-and-running-python-effectively

Python
8
star
70

guikit

Template to write GUIs based on wxPython that takes care of a large part of the boilerplate code to get started.
Python
8
star
71

BART-Int

Bayesian Probabilistic Numerical Integration with Tree-Based Models (using Bayesian Additive Regression Trees)
R
8
star
72

fragment-cloud

Semi-analytic atmospheric entry modelling for meteoroids
C++
8
star
73

grad_school_git_course

Using Git to Code, Collaborate and Share
HTML
8
star
74

virtual_ecosystem

This repository is the home for the codebase for the Virtual Ecosystem project.
Python
8
star
75

ReCoDE_Diffusion_Code

Repository for the ReCoDE project which aims to solve the Neutron Diffusion Equation
Fortran
8
star
76

cardiovascular_ageing

HTML
8
star
77

3DKSL

3D Motion Segmentation of Articulated Rigid Bodies based on RGB-D data
C++
7
star
78

RCDS-intro-to-r

Imperial College London / Graduate School / Data Science / Introduction to R
HTML
7
star
79

pure-maths-yamls

Descriptions of the main theorems and definitions in all the pure maths courses at Imperial
7
star
80

tcc-lean-alg-geom-2022

Experiments in algebraic geometry as part of the EPSRC Taught Course Centre course on formalising number theory and geometry
Lean
7
star
81

Computer_Vision_2022

Jupyter Notebook
7
star
82

acoustics-db

Python
7
star
83

al_cfd_benchmark

Active learning based regression for CFD cases
C++
7
star
84

rcs-pacemakers

Example of GPU-accelerated machine learning on the RCS compute cluster using Jupyter and conda
Jupyter Notebook
7
star
85

Computer_Vision_2020

CO315: Computer Vision, Spring Term, 2019 - 2020
Jupyter Notebook
6
star
86

RCDS-data-processing-with-r

Imperial College London / Graduate School / Data Science / Data Processing with R
HTML
6
star
87

django-passwordless-login

Login to your Django app with a link sent by email.
Python
6
star
88

covid19cumdeaths

R
6
star
89

RCDS-basic-statistics

Imperial College London / Graduate School / Data Science / Basic Statistics
R
6
star
90

ReCoDE_IDMS

HTML
6
star
91

Computer_Vision_2023

Courseworks for Computer Vision 2023 (Spring Term)
Jupyter Notebook
6
star
92

rcs_flask_aad_login

Python package to allow Flask web applications to single sign-on through IC's Azure Active Directory
Python
6
star
93

Y2CL_Worksheet_Template

2nd Year Physics Computing Laboratory Worksheet
Python
6
star
94

ReCoDE_rnaseq_pipeline

A parallelised pipeline for the analysis of RNA sequencing data. This repository is part of Imperial College London's ReCoDE project, which aims to support teaching and learning in research computing and data science.
Shell
6
star
95

condensed-sets

Condensed mathematics in Lean
Lean
5
star
96

MicroprocessorsLab

Code repository for Physics 3rd year Microprocessors Lab
Assembly
5
star
97

M1F_example_sheets

M1F 2018-19 example sheets in Lean
Lean
5
star
98

covid19local

Website for covid19 local analysis
HTML
5
star
99

openFrame

This repository is for the openFrame microscope and supporting projects
5
star
100

BSplinesProjectedGPs

R
5
star