Code for modelling estimated deaths and cases for COVID19.
Перейти к файлу
Adam Fiksen 73f1474a07 Merge branch 'master' of https://github.com/Azure/covid19model 2020-04-20 19:57:32 -07:00
.github Create preview action to deploy preview data 2020-04-14 20:23:53 -07:00
Python fix path 2020-04-05 15:54:57 +01:00
config add in config 2020-04-03 11:38:00 +01:00
data Change file extension to lower case 2020-04-11 17:39:03 +02:00
docker Missing changes to the docker/README.md 2020-04-11 18:07:13 +02:00
figures Code transfer for releasing code for Europe covid19 model 2020-03-27 07:05:06 +00:00
results delete dummy data 2020-04-14 20:42:24 -07:00
stan-models Version 2 2020-04-09 16:00:16 +01:00
utils adding for permission from author 2020-03-27 10:12:09 +00:00
.dockerignore New Dockerfile 2020-04-11 01:01:37 +02:00
.gitattributes Add to .gitattributes to ensure shell scripts have LF line endings 2020-04-02 14:18:39 +01:00
.gitignore Merge 2020-04-10 19:10:15 +02:00
CODE_OF_CONDUCT.md Initial CODE_OF_CONDUCT.md commit 2020-04-08 14:38:28 -07:00
LICENSE Updating LICENSE to template content 2020-04-08 14:38:30 -07:00
README.md fix merge conflicts 2020-04-14 20:17:50 -07:00
SECURITY.md Initial SECURITY.md commit 2020-04-08 14:38:31 -07:00
Technical_description_of_Imperial_COVID_19_Model.pdf Adding the technical description of new model 2020-04-09 18:19:17 +01:00
base.r Moved font fix into web-verify-output 2020-04-12 15:39:52 +02:00
contributing.md Update contributing.md 2020-04-05 21:30:35 +01:00
covariate-size-effects.r Replaced internal helper function with public one 2020-04-15 19:34:54 +02:00
covid19model.Rproj Code transfer for releasing code for Europe covid19 model 2020-03-27 07:05:06 +00:00
environment.yml Add additional web output and figure handling 2020-04-10 19:45:56 +02:00
make-table.r Add additional web output and figure handling 2020-04-10 19:45:56 +02:00
plot-3-panel.r fix merge 2020-04-20 19:57:02 -07:00
plot-forecast.r Fixed minor bugs in plot code 2020-04-15 22:51:51 +03:00
web-fetch-and-run.r Add fetch and run script for execution on Azure batch 2020-04-11 15:07:22 +02:00
web-verify-output.r Now also fixing fonts for intervention figures 2020-04-13 19:42:51 +02:00

README.md

covid19model

Code for modelling estimated deaths and cases for COVID19 from Report 13 published by MRC Centre for Global Infectious Disease Analysis, Imperial College London: Estimating the number of infections and the impact of nonpharmaceutical interventions on COVID-19 in 11 European countries

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

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.

When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

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

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.

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 has the stored stan fits and data used for plotting
  • Figures have the images with daily cases, daily death and Rt for all countries.

Notice

  • Python code is right now not updated and won't work. Python code is good for only version 1 model and data.