Logistic Growth Model for COVID-19

Mads Bahrami and Brian Wood
Wolfram Research, Inc.
A logistic growth model can be used to track the coronavirus COVID-19 outbreak. It has been widely used to model population growth with limited resources and space. Epidemic dynamics, expressed as a cumulative number of cases or deaths, can use the same model when the primary method of control is quarantine—as in the case of a novel viral infection.
A logistic function is a common sigmoid curve with the formula
L(1+
-k(t-
t
0
)

)
, where
k
is the growth rate factor determining the rate of infection spread,
L
is the max number of infected people and
t
0
is the time of the peak of the epidemic on an arbitrary time scale (i.e. the
x
value of the sigmoid’s midpoint).
The goal of this notebook is to explore the logistic function in detail, demonstrate that it is a good model for quarantine-limited epidemics and show how the model can be used to track an epidemic.

Mathematical Details of the Logistic Function

Differential Equation

Logistic growth is defined by the differential equation
f(t)
t
kf(t)1-
f(t)
L
,
where
f(t)
is the cumulative count of infected cases at time
t
,
k
is a continuous growth rate and
L
is the limit to growth such that
f(t)
cannot exceed
L
. When
f(t)
is small relative to
L
, the growth is nearly proportional to
f(t)
, implying an exponential increase in
f(t)
with the rate
k
.
We can use the
DSolve
function to solve this simple differential equation.
Solve the equation with the given constraints:
In[]:=
DSolve[{f'[t]kf[t](1-f[t]/L),f[t0]L/2},f[t],t]//FullSimplify//Quiet
Out[]=
f[t]
kt

L
kt

+
kt0


Simplify the solution:
In[]:=
Divide@@ExpandExp[-kt]NumeratorDenominator
kt

L
kt

+
kt0

//Simplify
Out[]=
L
1+
k(-t+t0)

The boundary condition
f(
t
0
)=
L
2
sets
t
0
to be the inflection point where growth rate is maximum, i.e. the time of the peak of the epidemic.
Verify that
t
0
is an inflection point:
In[]:=
SolveD
L
1+
k(-t+t0)

,{t,2}0,t,Reals
Out[]=
{{tt0}}

Exploring Parameters

Each parameter has a straightforward effect on the function.
L
simply changes the scale on the
y
axis, and
t
0
shifts the location of the center of the function on the
x
axis. The logistic function is symmetric horizontally and vertically about the point
t
0
,
L
2
, which is set as the axis origin on the logistic function graph.
k
is the rate parameter, which determines the duration of the epidemic.
A
Manipulate
expression can be used to show the effect of each parameter on the logistic function.
Interactively explore the effects of changing
L
,
k
and
t
0
:
In[]:=
ManipulateGraphicsRow​​Plot
L
1+
-k(t-t0)

,{t,0,60},
,Plot
k(t+t0)

kL
2
(
kt

+
kt0

)
,{t,0,60},
,​​{{L,1000},500,100000},{{k,0.3},0.1,1},{{t0,30},20,40},

Out[]=
​
L
k
t0

Computing Duration

One can assume that the epidemic starts and ends when the logistic function’s derivative equals one. Note that setting the first derivative equal to one has two solutions, one before
t
0
and one after
t
0
, corresponding to the beginning and end of epidemic, respectively.
Find the first solution for
f'(t)0
:
In[]:=
sol1=First@FullSimplifySolveD
L
1+
-k(t-t0)

,t1&&t<t0&&k>0,t,Reals,k>0&&kL>4
Out[]=
tt0+
Log
1
2
-2+kL-
kL(-4+kL)

k

Find the second, larger solution for
f'(t)0
:
In[]:=
sol2=First@FullSimplifySolveD
L
1+
-k(t-t0)

,t1&&t>t0&&k>0,t,Reals,k>0&&kL>4
Out[]=
tt0+
Log
1
2
-2+kL+
kL(-4+kL)

k

Compute the start and end of the epidemic:
In[]:=
{startOfEpidemic,endOfEpidemic}={t/.sol1,t/.sol2}//FullSimplify
Out[]=
t0+
Log
1
2
-2+kL-
kL(-4+kL)

k
,t0+
Log
1
2
-2+kL+
kL(-4+kL)

k

Compute the duration of the epidemic:
In[]:=
duration=endOfEpidemic-startOfEpidemic//FullSimplify
Out[]=
-Log-2+kL-
kL(-4+kL)
+Log-2+kL+
kL(-4+kL)

k

Application of the Logistic Model to Hubei

This model can be tested using the available data for Hubei province of China. Since quarantine measures were implemented in Hubei, we can safely use the logistic modeling. Additionally, we will consider the data only through the end of February, in order to test the logistic model forecasting for the end of epidemic.
Get a time series of confirmed cases for Hubei:
In[]:=
hubei=ResourceData["Epidemic Data for Novel Coronavirus COVID-19"]SelectFirst#AdministrativeDivision==
Hubei, China
ADMINISTRATIVE DIVISION
&,"ConfirmedCases";
Display the data on a log-scale plot:
In[]:=
DateListLogPlot[hubei,GridLinesAutomatic,PlotRangeAll,FrameTrue,FrameLabel{None,"Cumulative Cases"},PlotLabel"Hubei (China) Outbreak"]
Out[]=
Extract a portion of time series through the end of February:
In[]:=
data=TimeSeriesWindow[hubei,{hubei["FirstDate"],{2020,02,29}}];
Using
NonlinearModelFit
, a model can be fit to the logistic function.
Compute the model:
In[]:=
hubeiNLM=NonlinearModelFitdata["Values"],L(1+
-k(t-t0)

),{{k,0.3},{L,10000},{t0,50}},t;
See the parameters for the fit:
In[]:=
hubeiNLM@"ParameterConfidenceIntervalTable"
Now we can plot the model with 95% confidence interval along with the data points.
Return 95% confidence bands based on single observations:
Overlay the fit and 95% confidence band with the original data:
Finally, we can compute the duration of the epidemic directly from this fit.
Compute the duration of the epidemic from the fit:
Compute the end of the epidemic from the fit:
Show the derivatives with the original data:
Since March 16, the number of new cases reported in Hubei has been less than one case per day.
Show daily new cases since March 10:

Underlying Assumptions of the Logistic Function

The following is a brief explanation of the logic behind this model, as it pertains to quarantine-limited epidemics.
1
.
1
.
If treatment for the infection or vaccination becomes available during the epidemic, the rate of spread of infection might change as the epidemic progresses. Late in an epidemic that was not controlled, recovered individuals with immunity should also slow the spread. For the onset of a novel viral infection, statement #1 is true, and the other considerations in #1.1 are false.
2
.
The maximum growth rate of the number infected is a function of the number infected at that time:
2
.
2
.
In the real world, this may appear not to be true early in the outbreak, because at the time the outbreak is first noticed, there will be a backlog of infected cases which have not been discovered. They accumulate at the times they are discovered, so it is possible that early data may show exponential or faster growth rates.
3
.
Information about exposed contacts with infected persons must be collected at faster rates than the infection can spread in the population. Without this assumption, quarantine methods cannot succeed.
Completing the substitution yields the logistic differential equation:

Acknowledgment

This essay depends heavily on series of computational explorations by Dr. Bob Rimmer that are published on Wolfram Community.