/PopulationDynamics

Repository dedicated to my notes and analysis of population dynamics, with particular focus on the propagation of CoViD19

Primary LanguageJupyter NotebookOtherNOASSERTION

PopulationDynamics

Repository dedicated to my notes and analysis of population dynamics, focusing on the propagation of CoViD19.

Main reference file for this project is PopulationDynamics.ipynb, it contains all relevant information and points to other relevant files.

While the primary focus is the propagation of CoViD19, the model is general and easy to apply to any population whose growth is governed by a first order differential equation relating the rate of change of population to a function of both time (t) and population (n). The (initial) scope was restricted to separable functions of t and n, but we are now in the process of relaxing this restriction, by introducing further generalizations.

Important note to the readers: I am neither an epidemiologist or virologist! I'm just a curious physicist trying to understand and make some sense of the vast amounts of data on CoViD19 available online, and willing to share it for other curious minds to explore as well. It should go without saying, but I will still state the obvious advice nonetheless: ** None of information made available in this repository serves as credible source of information on COVID19 ** .

Data source:

We collected our data from two sources. First data source, used up to 2020-05-13 is the European Centre for Disease Prevention and Control (ECDC). Second data source, used from 2020-05-13 until present is the datahub.io dataset on CoViD19. This is sourced from this upstream repository maintained by the team at Johns Hopkins University Center for Systems Science and Engineering (JHU CSSE)

Primary reason to changing to the JHU CSSE data set was the absence of recovered data in the ECDC dataset.

Data is publicly available at:

Datasets identifiers

  • datahub.io/covid-19 (commit hash)
    1. 3df63747aeab5d03936459ccfdd536970a9db164 collected on 2020-06-08
  • ECDC (checksums available in sha256sums file)
    1. aRnzjSwT collected on 2020-04-17T21:29
    2. 6u83xREK collected on 2020-04-25T16:41

Contents of PopulationDynamics.ipynb

  1. Models under consideration
    1. the model
      1. Time-dependent environment: m- steady state model
      2. General time-dependent rates and decay times
      3. Coupled differential equations (SIR like models)
    2. application and discussion
      1. Korea
      2. Denmark
      3. Portugal
  2. Review of the differential equations
    1. Constant environments
      1. exponential growth
      2. logistic equation
      3. growth rate coefficient
    2. Time dependent environments
      1. m- transitions between steady states
      2. smooth transitions
      3. the Gamma distribution

Code organization and programming language

As this project grew in size, I decided to move all code to external files, thus dedicating this primary notebook to theory and discussion. The results discussed in this file are generated by the following notebooks

  • Korea.ipynb
  • Denmark.ipynb
  • Portugal.ipynb

that can be found in the root folder for this project.

User defined auxiliary function are made available via two modules

  • MyFunctions.jl: general purpose user defined functions;
  • Mrate.jl: dedicated to m-steady state model and SIR like model functions.

All code was written with Julia 1.4.x, for reference see the official documentation. Additional required packages and modules (for Julia only):

  • SpecialFunctions
  • MyFunctions, Mrate (local modules provided in the repository)
  • DataFrames, Query, CSV, Dates
  • LsqFit (logistic model only)
  • DifferentialEquations, DiffEqParamEstim, Optim
  • Plots, LaTeXStrings A python 3.x version is in the pipeline, but priority is given to project development using Julia.

Coupled differential equations are integrated numerically using the open source suite DifferentialEquations.jl provided by https://sciml.ai/. The parameter estimation is performed with DiffEqParamEstim.jl which in turn uses Optim.jl. The above-mentioned software packages are written in Julia and are available for Julia, Python and R.