In this repository, one will find the codes used to simulate the COVID-19 model in "A model for COVID-19 with isolation, quarantine, and testing as control measures" (https://doi.org/10.1016/j.epidem.2021.100437), written by M. S. Aronna, R. Guglielmi, and L. M. Moschen, and the codes used for the estimation of the underreporting rate of COVID-19 cases in the city of Rio de Janeiro.
In this article we propose a compartmental model for the dynamics of Coronavirus Disease 2019(COVID-19). We take into account the presence of asymptomatic infections and the main policies that have been adopted so far for the combat of this disease: isolation (or social distancing) ofa portion of the population, quarantine for confirmed cases and testing. We model isolation by separating the population in two groups: one composed by key-workers that keep working during the pandemic and have a usual contact rate, and a second group consisting of people that are enforced/recommended to stay at home. We refer to quarantine as strict isolation, and it is applied to confirmed infected cases.
In the proposed model, the proportion of people in isolation, the level of contact reduction and the testing rate are control parameters that can vary in time, representing policies that evolve indifferent stages. We obtain an explicit expression for the basic reproduction numberR0in terms of the parameters of the disease and of the control policies. In this way we can quantify the effect that isolation and testing have in the evolution of the epidemic. We present a series of simulations to illustrate different realistic scenarios. From the expression ofR0and the simulations we conclude that isolation (social distancing) and testing among asymptomatic cases are fundamental actions to control the epidemic, and the stricter these measures are and the sooner they are implemented, the more lives can be saved. Additionally, we show that people that remain in isolation significantly reduce their probability of contagion, so risk groups should be recommended to maintain a low contact rate during the course of the epidemic.
In the folder notes
, one can find the report of my scientific initiation
(written in portuguese) with the following abstract:
The COVID-19 disease caused by the SARS-CoV-2 virus has been spreading rapidly over the world since the beginning of 2020. The understanding of its dynamics in the population is crucial to take measures that contain the spread. In this report, we consider the epidemiological model SEIAQR aforementioned to understand the beginning of the epidemic in the city of Rio de Janeiro and, in particular, the underreporting rate, that is, the proportion of infected individuals that the system didn't register. The curves of confirmed cases and deaths were adjusted to the actual city data using the error-weighted least squares method. We use B-splines to approximate the transmissibility and mortality of the disease. Also, we analyze the structural and practical identifiability of the model to verify the feasibility of the estimates. We used the Bootstrap method to quantify the uncertainty about the parameter's estimates. In the period March-July 2020, we obtain the point estimate of 0.9 for underreporting with a 95 % confidence interval (0.85, 0.93).
We organize it as follows:
├── data
│ ├── covid_data_organized.csv
│ ├── parameters.yaml
├── experiments
├── identifiability
│ └── covid_model_id.txt
├── images
├── notebooks
│ ├── bootstrap_results.ipynb
│ ├── data_analysis.ipynb
│ └── model_fitting.ipynb
├── notes
│ ├── underreporting_estimation.pdf
├── pyscripts
│ ├── bootstrap.py
│ ├── dynamics_model.py
│ ├── estimation.py
│ ├── execute_model.py
│ ├── initial_estimation.py
│ └── scenarios.py
└── README.md
This structure includes:
data
: COVID-19 raw and organized data from Rio de Janeiro, parameters for simulations, and variables saved after the simulations;experiments
: bootstrap and fitting;notebooks
: where we do the experiments. One should follow the order data analysis, model fitting, and bootstrap results;pyscripts
: scripts written in Python. The explanation for each one is below.bootstrap.py
: parametric bootstrap used in the report;dynamics_model.py
: differential equations from the model;estimation.py
: estimates the overall confirmed case curve and death curve;execute_model.py
: after changing the parameters inparameter.yaml
, run this code to simulate the model;initial_estimation.py
: estimates the initial curve of the confirmed cases;scenarios.py
: calculate the scenarios explained in the article and save them into thetable_values.txt
file.
We expect it is the most reproducible that it can be. To experiment, one needs:
- Have Python 3 installed. One can check this here.
- Clone this repository in your machine with the command
git clone https://github.com/lucasmoschen/covid-19-model
- Install the requirements with
pip install -r requirements.txt
After the steps above, so as to experiment the model, it's needed to follow these steps:
- Change the parameters in the
parameters.yaml
. Maintain the format of the file as already is. Thechange_p
parameter is reserved to the date when p change. It can be one, for now. - Change the variable functions in the class
Parameters_Functions
indynamics_model.py
file. - Enter in the
pyscripts
folder and runpython execute_model.py
. Follow the instructions to save the variables in the terminal.
If you want to reproduce the results in the article or change the values and see how it affects each scenario, it's necessary to follow these steps:
- Access the
scenarios.py
file and change the parameters values in your way. - Enter in the
pyscripts
folder and runpython scenarios.py
. The result will be indata/table_values.txt
.
Please, for any suggestions, write an issue, and I will answer as quickly as I can. Thanks!