COVID-19 Analysis calculus

Disclaimer

This document demonstrates a very simple mathematical model, a differential equation called the logistic equation which is a special case to Bernoulli equation. The purpose was to illustrate mathematical modeling with simple ordinary differential equations in context to COVID-19 data for my mobile application COVID19 Tracker'COVID-19\ Tracker'. I am not a health expert, this document should not be taken too seriously.

The Math: Exponential vs Logistic

The spread of infectious disease can be modeled using a logistic curve rather than an exponential curve. The growth starts exponentially, but must slow down after some point called the inflection point. The inflection point is essentially the midpoint of the spread. We will model the number of confirmed cases using a logistic curve. Let's look at the equation for such a curve, the differential equation for which this curve is a solution, and the graph of the curve.

Logistic curve graph

logistic curve graph

Logistic function

A logistic function or a logistic curve is an equation of the form

f(x)=N1+ek(xxo)f(x) = \frac{N}{1+e^{-k(x-x_o)}}


where

  • xox_o = the inflection point
  • NN = the curves maximum value
  • kk = growth rate or steepness of the curve

Actually, the logistic function is just a solution for the following first-order, non-linear ordinary differential equation called the Logistic Differential Equation where f(x0)=N2f(x_0) = \frac{N}{2}

ddxf(x)=f(x)(Nf(x))\frac{d}{dx}f(x) = f(x)(N-f(x))

From the differential equation, stability of solutions and equilibria can be explored. However, this may not be directly helpful in predicting confirmed cases, so let's keep things simple for now and just look at the growth metrics.

The Analysis

Now that we have seen the math, let's explore the following growth metrics for the confirmed cases:

  • Growth Factor
  • Growth Ratio
  • Growth Rate
  • 2nd2^{nd} Derivative

The GrowthFactorGrowth Factor on day NN is the confirmed cases on that day devided by confirmed cases on the previous day.
The GrowthRatioGrowth Ratio on day NN is the total confirmed cases on that day devided by the total confirmed cases on previous day
The GrowthRateGrowth Rate is simply the 1st1^{st} derivative.

These metrics gives insight into which countries may have already hit inflection points. For example, if a country's growth factor has stabilized around 1.0 then this can be a sign that that country has reached it's inflection point.

If we take our data and take the 2nd2^{nd} derivative, basically all it is telling us is whether the cases are growing at an accelerating or decelerating rate. From calculus you may remember we use the 2nd2^{nd} derivative test to test for concavity and find inflection points. The inflection point is where the curve changes concavity.

In other words if 2nd2^{nd} derivative is negative the 1st1^{st} derivative that is the growth rate will go down and vice versa.

Data sources



Importing data

importing data ss

Growth Factor calculations

growth factor method

Growth Ratio calculation

growth ratio method

1st1^{st} Derivative calculation

The function works same as numpy.gradient() in python.

first derivative method

Execution

execution

Growth rate is defined as kk in the logistic function presented at the beginning of this document.



INDIA



India growth factor

India growth ratio

India growth rate

India second derivative



Author:

Prateek Kumar Oraon3rd year undergraduateNIT SikkimPrateek\ Kumar\ Oraon\\3^{rd}\ year\ undergraduate\\NIT\ Sikkim

BACK