bnb32 / covid19_website

Web deployment of corona modelling project

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

README

What is this repository for?

This repo includes tools to solve a full SEAIQHRD compartmental infectious disease model. This model reduces to simpler more familiar models, such as SIR and SEIR, with the appropriate parameter values. The full model solves the following equations:

seaiqhrd

The S,E,A,I,Q,H,R,D compartments represent Susceptible, Exposed, Asymptomatic-Infected, Symptomatic-Infected, Self-Quarantined, Hospitalized, Recovered, and Dead members of the total population N.

All parameters of the following form represent mean times for transitions between compartments:

params

Parameters of the following form represent probabilities for transitions between compartments:

probs

How do I get set up?

To solve the previous equations initial values for all compartments and parameter values must be specified. The repo is currently setup to download new_cases, total_cases, deaths, and hospitalizations from COVID case sources, in addition to population data (N) for a specified state. Using this data compartments can be initialized and probabilities for death and hositalization can be computed. Transition times between compartments must be specified manually, as well as the probabilities for some transitions.

Current COVID research suggests a recovery time of 14 days (Tir: I->R), an incubation time of 5 days (Tai: A->I), a time from development of symptoms to death 30 days (Tid: I->D), and a probability of developing symptoms once infected of roughly 0.6 (pai: A->I). As COVID does not seem to have a non-contagious latency period we use a minimum time from exposure to asymptomatic (Tea: E->A) of one time step. We also assume once an individual recognizes symptoms they will self-quarantine in a single time step (Tiq: I->Q) with a probability of 0.9 (piq: I->Q).

The doubling rate (Td), and subsequently beta, can be computed by approximating initial growth as exponential and performing a linear regression:

doubling

The length of data to use for this regression can be manually specified.

The main routine in __init__.py takes the following arguments:

state: US state
county: US county
n_days: number of days to simulate
Tea: mean time from exposure to asymptomatic (latency time)
Tiq: mean time from recognizing symptoms to self-quarantine
Tai: mean time to develop symptoms from initial infection (incubation time)
Tir: mean time to recover after developing symptoms
Tid: mean time from developing symptoms to death
Tih: mean time to be hospitalized after developing symptoms
Tqh: mean time to be hospitalized after self-quarantine
piq: probability to self-quarantine after recognizing symptoms
pai: probability to develop symptoms after infection (symptomaticity ratio)
Sd: fractional reduction in physical contact
Sd_period: duration of contact reduction
Sd_delay: time to implement contact reduction
detection_rate: probability of detecting an infection
data_days: number of days of data to use for computing doubling time (Td)
n_substeps: time steps per day
R0: reproductive rate (calculate from data if negative)

  • All models are solved using 4th order Runge-Kutta, the details of which are in models.py. Functions for downloading data and initializing model are in fetch.py. Functions for plotting are in display.py. The main routine to run the model and plot is in __init__.py.
  • Required packages include: matplotlib, numpy, scipy

Contribution guidelines

  • Writing tests
  • Code review
  • Other guidelines

Who do I talk to?

  • Repo owner or admin
  • Other community or team contact

About

Web deployment of corona modelling project


Languages

Language:Python 84.6%Language:Shell 9.4%Language:JavaScript 3.2%Language:HTML 2.7%Language:Dockerfile 0.1%