WolframAlpha.com
WolframCloud.com
All Sites & Public Resources...
Products & Services
Wolfram|One
Mathematica
Wolfram|Alpha Notebook Edition
Finance Platform
System Modeler
Wolfram Player
Wolfram Engine
WolframScript
Enterprise Private Cloud
Application Server
Enterprise Mathematica
Wolfram|Alpha Appliance
Enterprise Solutions
Corporate Consulting
Technical Consulting
Wolfram|Alpha Business Solutions
Resource System
Data Repository
Neural Net Repository
Function Repository
Wolfram|Alpha
Wolfram|Alpha Pro
Problem Generator
API
Data Drop
Products for Education
Mobile Apps
Wolfram Player
Wolfram Cloud App
Wolfram|Alpha for Mobile
Wolfram|Alpha-Powered Apps
Services
Paid Project Support
Wolfram U
Summer Programs
All Products & Services »
Technologies
Wolfram Language
Revolutionary knowledge-based programming language.
Wolfram Cloud
Central infrastructure for Wolfram's cloud products & services.
Wolfram Science
Technology-enabling science of the computational universe.
Wolfram Notebooks
The preeminent environment for any technical workflows.
Wolfram Engine
Software engine implementing the Wolfram Language.
Wolfram Natural Language Understanding System
Knowledge-based broadly deployed natural language.
Wolfram Data Framework
Semantic framework for real-world data.
Wolfram Universal Deployment System
Instant deployment across cloud, desktop, mobile, and more.
Wolfram Knowledgebase
Curated computable knowledge powering Wolfram|Alpha.
All Technologies »
Solutions
Engineering, R&D
Aerospace & Defense
Chemical Engineering
Control Systems
Electrical Engineering
Image Processing
Industrial Engineering
Mechanical Engineering
Operations Research
More...
Finance, Statistics & Business Analysis
Actuarial Sciences
Bioinformatics
Data Science
Econometrics
Financial Risk Management
Statistics
More...
Education
All Solutions for Education
Trends
Machine Learning
Multiparadigm Data Science
Internet of Things
High-Performance Computing
Hackathons
Software & Web
Software Development
Authoring & Publishing
Interface Development
Web Development
Sciences
Astronomy
Biology
Chemistry
More...
All Solutions »
Learning & Support
Learning
Wolfram Language Documentation
Fast Introduction for Programmers
Wolfram U
Videos & Screencasts
Wolfram Language Introductory Book
Webinars & Training
Summer Programs
Books
Need Help?
Support FAQ
Wolfram Community
Contact Support
Premium Support
Paid Project Support
Technical Consulting
All Learning & Support »
Company
About
Company Background
Wolfram Blog
Events
Contact Us
Work with Us
Careers at Wolfram
Internships
Other Wolfram Language Jobs
Initiatives
Wolfram Foundation
MathWorld
Computer-Based Math
A New Kind of Science
Wolfram Technology for Hackathons
Student Ambassador Program
Wolfram for Startups
Demonstrations Project
Wolfram Innovator Awards
Wolfram + Raspberry Pi
Summer Programs
More...
All Company »
Search
WOLFRAM COMMUNITY
Connect with users of Wolfram technologies to learn, solve problems and share ideas
Join
Sign In
Dashboard
Groups
People
Message Boards
Answer
(
Unmark
)
Mark as an Answer
GROUPS:
Staff Picks
Data Science
Medical Sciences
Mathematica
Calculus
Modeling
8
Robert Rimmer
[NB] Logistic Model for Quarantine Controlled Epidemics
Robert Rimmer
Posted
2 years ago
10396 Views
|
6 Replies
|
8 Total Likes
Follow this post
|
MODERATOR NOTE: coronavirus resources & updates:
https://wolfr.am/coronavirus
A logistic growth model tracks the Coronavirus COVID-19 epidemic, using the data provided by
Johns Hopkins CSSE
and uploaded to
GitHub
. The data are also available from the
Wolfram Data Repository
. The model is very simple and follows the function proposed by Pierre François Verhulst 180 years ago. The original concept behind the function was to model population growth, which should be limited by lack of 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.
There are only three parameters to the function. The parameter, k, is the growth rate factor; this parameter is determines the rate of infection spread and how long the epidemic will last. The parameter, L, is the limit of the number of infected people or the subset of people who die. The t0 parameter is the time of the peak of the epidemic on an arbitrary time scale.
M
o
r
e
i
n
f
o
r
m
a
t
i
o
n
a
n
d
h
i
s
t
o
r
y
o
n
t
h
e
l
o
g
i
s
t
i
c
f
u
n
c
t
i
o
n
f
r
o
m
W
i
k
i
p
e
d
i
a
.
Readers, who do not wish to get into the mathematical weeds immediately, can look at the structure of the function and use the Manipulate cells at the end of the next section, then read “Why the Model Works” and jump to the last section which analyzes some actual data.
This notebook does not link to the databases, but contains all the
Mathematica
functions used to analyze the data. The goal is to explore the logistic function in detail, demonstrate that it is a good model for quarantine limited epidemics, and show some examples of how the model can be used to track an epidemic.
The Derivation of the Logistic Function
Logistic growth is defined by a differential equation. Let f(t) be the cumulative count of infected cases at time, t.
f
(
t
)
t
k
f
(
t
)
1
-
f
(
t
)
L
,
w
h
e
r
e
k
i
s
a
c
o
n
t
i
n
u
o
u
s
g
r
o
w
t
h
r
a
t
e
a
n
d
L
i
s
t
h
e
l
i
m
i
t
t
o
g
r
o
w
t
h
s
u
c
h
t
h
a
t
f
(
t
)
c
a
n
n
o
t
e
x
c
e
e
d
L
.
W
h
e
n
f
(
t
)
i
s
s
m
a
l
l
r
e
l
a
t
i
v
e
t
o
L
,
t
h
e
t
e
r
m
,
1
-
f
(
t
)
L
,
i
s
n
e
a
r
1
.
T
h
e
n
t
h
e
i
n
i
t
i
a
l
g
r
o
w
t
h
i
s
n
e
a
r
l
y
p
r
o
p
o
r
t
i
o
n
a
l
t
o
f
(
t
)
w
i
t
h
e
x
p
o
n
e
n
t
i
a
l
g
r
o
w
t
h
r
a
t
e
,
k
.
W
h
e
n
f
(
t
)
r
e
a
c
h
e
s
L
,
t
h
e
g
r
o
w
t
h
r
a
t
e
i
s
z
e
r
o
a
n
d
g
r
o
w
t
h
s
t
o
p
s
.
I
f
L
a
n
d
k
a
r
e
p
o
s
i
t
i
v
e
,
t
h
e
n
t
h
e
g
r
o
w
t
h
r
a
t
e
i
s
a
l
w
a
y
s
p
o
s
i
t
i
v
e
.
The DSolve function solves this simple differential equation.
D
S
o
l
v
e
[
{
f
'
[
t
]
k
f
[
t
]
(
1
-
f
[
t
]
/
L
)
,
f
[
t
0
]
L
/
2
}
,
f
[
t
]
,
t
]
/
/
F
u
l
l
S
i
m
p
l
i
f
y
O
u
t
[
]
=
f
[
t
]
k
t
L
k
t
+
k
t
0
This can be simplified:
E
x
p
[
-
k
t
]
N
u
m
e
r
a
t
o
r
D
e
n
o
m
i
n
a
t
o
r
k
t
L
k
t
+
k
t
0
/
/
E
x
p
a
n
d
#
1
/
#
2
&
@
@
%
/
/
S
i
m
p
l
i
f
y
F
u
l
l
S
i
m
p
l
i
f
y
k
t
L
k
t
+
k
t
0
L
1
+
k
(
-
t
+
t
0
)
This proves the solution using the differential equation:
D
L
1
+
k
(
-
t
+
t
0
)
,
t
k
L
1
+
k
(
-
t
+
t
0
)
1
-
L
1
+
k
(
-
t
+
t
0
)
L
/
/
F
u
l
l
S
i
m
p
l
i
f
y
The boundary condition, f(t0)
L/2, sets t0 to be the inflection point where growth rate is maximum, i.e. the time of the peak of the epidemic.
S
o
l
v
e
D
L
1
+
k
(
-
t
+
t
0
)
,
{
t
,
2
}
0
,
t
,
R
e
a
l
s
The manipulate cell shows how the parameters affect the logistic function. L simply changes the scale on the y-axis, t0 changes the location of the center of the function on the x-axis. The logistic function is symmetric horizontally and vertically about the point, {t0, 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.
M
a
n
i
p
u
l
a
t
e
G
r
a
p
h
i
c
s
C
o
l
u
m
n
P
l
o
t
L
1
+
-
k
(
t
-
t
0
)
,
{
t
,
0
,
6
0
}
,
A
x
e
s
O
r
i
g
i
n
{
t
0
,
L
/
2
}
,
A
x
e
s
L
a
b
e
l
{
"
T
i
m
e
"
,
"
C
u
m
u
l
a
t
i
v
e
C
a
s
e
s
"
}
,
P
l
o
t
R
a
n
g
e
A
l
l
,
P
l
o
t
L
a
b
e
l
"
L
o
g
i
s
t
i
c
F
u
n
c
t
i
o
n
"
,
P
l
o
t
k
(
t
+
t
0
)
k
L
2
(
k
t
+
k
t
0
)
,
{
t
,
0
,
6
0
}
,
P
l
o
t
S
t
y
l
e
L
i
g
h
t
e
r
@
O
r
a
n
g
e
,
P
l
o
t
R
a
n
g
e
A
l
l
,
A
x
e
s
L
a
b
e
l
{
"
T
i
m
e
"
,
"
C
a
s
e
s
p
e
r
U
n
i
t
T
i
m
e
"
}
,
P
l
o
t
L
a
b
e
l
"
F
i
r
s
t
D
e
r
i
v
a
t
i
v
e
L
o
g
i
s
t
i
c
F
u
n
c
t
i
o
n
"
,
{
{
L
,
1
0
0
0
}
,
5
0
0
,
1
0
0
0
0
0
}
,
{
{
k
,
0
.
3
}
,
0
.
1
,
1
}
,
{
{
t
0
,
3
0
}
,
2
0
,
4
0
}
,
C
o
n
t
i
n
u
o
u
s
A
c
t
i
o
n
T
r
u
e
,
S
a
v
e
D
e
f
i
n
i
t
i
o
n
s
T
r
u
e
O
u
t
[
]
=
The denominator of the logistic function, in orange, approaches the limit, 1, as time increases. As the denominator approaches 1, the function approaches the limit, L. The growth rate parameter, k, controls how quickly the limit is reached. For the epidemiologic data the time scale will be in days.
M
a
n
i
p
u
l
a
t
e
[
P
l
o
t
[
E
v
a
l
u
a
t
e
[
-
k
(
t
-
t
0
)
,
1
+
-
k
(
t
-
t
0
)
/
.
{
t
0
0
,
k
0
.
5
}
]
,
{
t
,
-
1
,
5
0
}
,
P
l
o
t
L
e
g
e
n
d
s
"
E
x
p
r
e
s
s
i
o
n
s
"
,
G
r
i
d
L
i
n
e
s
{
N
o
n
e
,
{
{
1
,
{
B
l
a
c
k
,
T
h
i
c
k
}
}
}
}
,
P
l
o
t
L
a
b
e
l
"
L
o
g
i
s
t
i
c
D
e
n
o
m
i
n
a
t
o
r
"
,
A
x
e
s
L
a
b
e
l
{
"
T
i
m
e
"
,
N
o
n
e
}
]
,
{
{
k
,
0
.
5
}
,
0
.
0
1
,
1
}
,
S
a
v
e
D
e
f
i
n
i
t
i
o
n
s
T
r
u
e
,
C
o
n
t
i
n
u
o
u
s
A
c
t
i
o
n
T
r
u
e
]
O
u
t
[
]
=
Assuming the epidemic begins when the logistic function equals one, the duration of the epidemic can be calculated.
s
o
l
=
R
e
f
i
n
e
S
o
l
v
e
L
1
+
-
k
(
t
-
t
0
)
1
,
t
,
R
e
a
l
s
,
L
>
1
/
/
P
o
w
e
r
E
x
p
a
n
d
/
/
S
i
m
p
l
i
f
y
O
u
t
[
]
=
t
t
0
-
L
o
g
[
-
1
+
L
]
k
By symmetry, where t0 is the time at mid-point, the duration would be:
2
(
t
0
-
t
)
/
.
s
o
l
[
[
1
]
]
O
u
t
[
]
=
2
L
o
g
[
-
1
+
L
]
k
For the epidemiologic data with t in days, the units are days.
Logistic Distribution
If 1 is substituted for L, the logistic function becomes a distribution function with domain, {-
∞
,
∞
} and range {0, 1}. To put it into the form of the
Mathematica
LogisticDistribution[], we make some additional substitutions.
L
1
+
-
k
(
t
-
t
0
)
/
.
{
L
1
,
t
0
μ
,
k
1
/
β
,
t
x
}
C
D
F
[
L
o
g
i
s
t
i
c
D
i
s
t
r
i
b
u
t
i
o
n
[
μ
,
β
]
,
x
]
O
u
t
[
]
=
1
1
+
-
x
-
μ
β
O
u
t
[
]
=
1
1
+
-
x
-
μ
β
We have already seen the density function which is the first derivative.
P
D
F
[
L
o
g
i
s
t
i
c
D
i
s
t
r
i
b
u
t
i
o
n
[
μ
,
β
]
,
x
]
O
u
t
[
]
=
-
x
-
μ
β
2
1
+
-
x
-
μ
β
β
The differential equation for the distribution function is:
′
F
(
x
)
F
(
x
)
(
1
-
F
(
x
)
)
β
In this form it becomes clear the the term (1 - F(x)) is the survival function of the distribution.
D
S
o
l
v
e
[
{
F
'
[
x
]
F
[
x
]
(
1
-
F
[
x
]
)
/
β
,
F
[
μ
]
1
/
2
}
,
F
[
x
]
,
x
]
O
u
t
[
]
=
F
[
x
]
x
/
β
x
/
β
+
μ
β
This can be simplified.
E
x
p
[
-
x
/
β
]
N
u
m
e
r
a
t
o
r
D
e
n
o
m
i
n
a
t
o
r
x
/
β
x
/
β
+
μ
β
/
/
S
i
m
p
l
i
f
y
;
#
1
/
#
2
&
@
@
%
O
u
t
[
]
=
1
1
+
-
x
+
μ
β
A statistical density function is the first derivative of the distribution function. The differential equation in this form is true. The concept of the (1 - F[x]) term as a survival probability is used later to justify the use of the logistic function to model quarantine limited epidemics.
P
D
F
[
L
o
g
i
s
t
i
c
D
i
s
t
r
i
b
u
t
i
o
n
[
μ
,
β
]
,
x
]
=
=
C
D
F
[
L
o
g
i
s
t
i
c
D
i
s
t
r
i
b
u
t
i
o
n
[
μ
,
β
]
,
x
]
S
u
r
v
i
v
a
l
F
u
n
c
t
i
o
n
[
L
o
g
i
s
t
i
c
D
i
s
t
r
i
b
u
t
i
o
n
[
μ
,
β
]
,
x
]
/
β
/
/
S
i
m
p
l
i
f
y
O
u
t
[
]
=
T
r
u
e
Other calculations are built in.
M
e
a
n
@
L
o
g
i
s
t
i
c
D
i
s
t
r
i
b
u
t
i
o
n
[
μ
,
β
]
M
e
d
i
a
n
@
L
o
g
i
s
t
i
c
D
i
s
t
r
i
b
u
t
i
o
n
[
μ
,
β
]
V
a
r
i
a
n
c
e
@
L
o
g
i
s
t
i
c
D
i
s
t
r
i
b
u
t
i
o
n
[
μ
,
β
]
S
t
a
n
d
a
r
d
D
e
v
i
a
t
i
o
n
@
L
o
g
i
s
t
i
c
D
i
s
t
r
i
b
u
t
i
o
n
[
μ
,
β
]
O
u
t
[
]
=
μ
O
u
t
[
]
=
μ
O
u
t
[
]
=
2
π
2
β
3
O
u
t
[
]
=
π
β
3
Hyperbolic functions show up in the characteristic function, which can be obtained eventually by Integrate.
Mathematica
cannot seem to simplify this without removing the term which adds the location parameter, then putting it back.
c
f
0
=
I
n
t
e
g
r
a
t
e
E
x
p
[
I
t
x
]
-
x
-
μ
β
2
1
+
-
x
-
μ
β
β
,
{
x
,
-
∞
,
∞
}
,
A
s
s
u
m
p
t
i
o
n
s
{
t
∈
R
e
a
l
s
,
x
∈
R
e
a
l
s
,
μ
∈
R
e
a
l
s
,
β
>
0
}
c
f
0
/
.
μ
0
/
/
F
u
n
c
t
i
o
n
E
x
p
a
n
d
/
/
S
i
m
p
l
i
f
y
/
/
E
x
p
[
I
μ
t
]
#
&
O
u
t
[
]
=
1
-
μ
β
t
β
H
y
p
e
r
g
e
o
m
e
t
r
i
c
2
F
1
1
,
1
-
t
β
,
2
-
t
β
,
-
μ
β
+
t
β
+
-
μ
β
t
β
H
y
p
e
r
g
e
o
m
e
t
r
i
c
2
F
1
1
,
1
+
t
β
,
2
+
t
β
,
-
-
μ
β
-
t
β
O
u
t
[
]
=
t
μ
π
t
β
C
s
c
h
[
π
t
β
]
The characteristic function is, of course, already built in.
C
h
a
r
a
c
t
e
r
i
s
t
i
c
F
u
n
c
t
i
o
n
[
L
o
g
i
s
t
i
c
D
i
s
t
r
i
b
u
t
i
o
n
[
μ
,
β
]
,
t
]
O
u
t
[
]
=
t
μ
π
t
β
C
s
c
h
[
π
t
β
]
When the mean is zero, this is a real function symmetric about the y-axis.
P
l
o
t
[
π
t
β
C
s
c
h
[
π
t
β
]
/
.
β
1
,
{
t
,
-
5
,
5
}
]
O
u
t
[
]
=
The density can be recovered easily, from the hyperbolic form.
I
n
v
e
r
s
e
F
o
u
r
i
e
r
T
r
a
n
s
f
o
r
m
[
t
μ
π
t
β
C
s
c
h
[
π
t
β
]
,
t
,
x
,
F
o
u
r
i
e
r
P
a
r
a
m
e
t
e
r
s
{
1
,
1
}
]
P
D
F
[
L
o
g
i
s
t
i
c
D
i
s
t
r
i
b
u
t
i
o
n
[
μ
,
β
]
,
x
]
/
/
E
x
p
T
o
T
r
i
g
/
/
S
i
m
p
l
i
f
y
O
u
t
[
]
=
2
S
e
c
h
x
-
μ
2
β
4
β
O
u
t
[
]
=
2
S
e
c
h
x
-
μ
2
β
4
β
But the forward statistical Fourier transform is not helped by the trigonometric expression.
p
d
f
=
F
o
u
r
i
e
r
T
r
a
n
s
f
o
r
m
2
S
e
c
h
x
-
μ
2
β
4
β
,
x
,
t
,
F
o
u
r
i
e
r
P
a
r
a
m
e
t
e
r
s
{
1
,
1
}
,
A
s
s
u
m
p
t
i
o
n
s
{
t
∈
R
e
a
l
s
,
x
∈
R
e
a
l
s
,
μ
∈
R
e
a
l
s
,
β
>
0
}
;
/
/
A
b
s
o
l
u
t
e
T
i
m
i
n
g
p
d
f
O
u
t
[
]
=
{
2
5
.
4
7
2
3
,
N
u
l
l
}
O
u
t
[
]
=
1
1
+
2
t
2
β
C
o
s
h
μ
β
-
S
i
n
h
μ
β
C
o
s
h
μ
β
+
2
t
2
β
C
o
s
h
μ
β
-
t
β
H
y
p
e
r
g
e
o
m
e
t
r
i
c
2
F
1
1
,
1
+
t
β
,
2
+
t
β
,
-
C
o
s
h
μ
β
+
S
i
n
h
μ
β
-
2
t
2
β
H
y
p
e
r
g
e
o
m
e
t
r
i
c
2
F
1
1
,
1
+
t
β
,
2
+
t
β
,
-
C
o
s
h
μ
β
+
S
i
n
h
μ
β
+
S
i
n
h
μ
β
+
2
t
2
β
S
i
n
h
μ
β
-
t
β
(
-
+
t
β
)
H
y
p
e
r
g
e
o
m
e
t
r
i
c
2
F
1
1
,
1
-
t
β
,
2
-
t
β
,
-
C
o
s
h
μ
β
-
S
i
n
h
μ
β
C
o
s
h
2
μ
β
+
S
i
n
h
2
μ
β
p
d
f
/
.
μ
0
/
/
S
i
m
p
l
i
f
y
/
/
F
u
n
c
t
i
o
n
E
x
p
a
n
d
/
/
C
o
m
p
l
e
x
E
x
p
a
n
d
/
/
S
i
m
p
l
i
f
y
/
/
E
x
p
[
I
μ
t
]
#
&
O
u
t
[
]
=
t
μ
π
t
β
C
s
c
h
[
π
t
β
]
The distribution and logistic functions can also be expressed in hyperbolic form.
E
x
p
T
o
T
r
i
g
@
C
D
F
[
L
o
g
i
s
t
i
c
D
i
s
t
r
i
b
u
t
i
o
n
[
μ
,
β
]
,
x
]
E
x
p
T
o
T
r
i
g
L
1
+
-
k
(
t
-
t
0
)
O
u
t
[
]
=
1
1
+
C
o
s
h
x
β
-
μ
β
-
S
i
n
h
x
β
-
μ
β
O
u
t
[
]
=
L
1
+
C
o
s
h
[
k
t
-
k
t
0
]
-
S
i
n
h
[
k
t
-
k
t
0
]
A Closer Look at the Differential Equation
The differential equation for the logistic equation is simplified below.
f
'
[
t
]
k
f
[
t
]
(
1
-
f
[
t
]
/
L
)
Changing f[t] to x, where x is the number of cumulative cases, the model is shown below.
I
n
[
]
:
=
d
e
M
o
d
e
l
=
k
x
1
-
x
L
;
Note that this is a quadratic function. The equation has roots at zero and L, and its peak value occurs when x = L/2.
S
o
l
v
e
[
d
e
M
o
d
e
l
0
,
x
]
D
[
d
e
M
o
d
e
l
,
x
]
/
/
E
x
p
a
n
d
A
l
l
S
o
l
v
e
[
%
0
,
x
]
O
u
t
[
]
=
{
{
x
0
}
,
{
x
L
}
}
O
u
t
[
]
=
k
-
2
k
x
L
O
u
t
[
]
=
x
L
2
A plot of this quadratic equation is shown below. The epidemic ends when the accumulated case count reaches the limit L. Between 0 and L, the growth rate is always positive and the equation is symmetric about L/2 on the x-axis. It will be shown in the next sections that the epidemiologic data is consistent with this model.
O
u
t
[
]
=
The stream plot shows how the logistic function evolves from the differential equation. The range of the function, below is between 0 and 1000. Along the zero line the vectors diverge and they converge at the 1000 limit.
O
u
t
[
]
=
Why the Model Works
The original derivation of the model was for population growth in a finite space with finite resources for population growth. The idea is that any space can only support some maximum number of inhabitants.
For the model to be applied to an epidemic requires only that there is an accurate and fast method of diagnosis of the infection and that effective quarantine can be applied to the population. Information about the contacts and possibly exposed individuals must also accumulate faster than the infection can spread.
At the onset of an epidemic a small number of cases are identified; an army of public health officials determines the quarantine set, Q, of people who are infected or have been exposed to the people who have the disease. Initially as more infected persons are discovered, Q grows. For an ideal quarantine model within Q people are isolated from the general population and from each other. The goal is that the infection cannot spread beyond Q or within Q, unless there was prior contact with another infected person before the individual was placed in Q. If the quarantine is successful then the set, L, all the people who have been or will eventually become infected, becomes a subset of Q. When that happens no further cases appear outside Q. The exact individuals in Q, who will belong to L, are not knowable initially, but the size of L can in fact be determined rather quickly from the logistic function once L becomes a subset of Q.
The graphic below attempts to illustrate the idea. Click the play button. At time = 0, there is no quarantine, as time increases, the quarantine set, Q, grows faster than the infected set L, once Q contains L, L stops growing, even though its elements may not all yet be fully countable.
M
a
n
i
p
u
l
a
t
e
[
P
a
r
a
m
e
t
r
i
c
P
l
o
t
[
E
v
a
l
u
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
r
f
(
t
)
Eventually the whole population will have the infection, but logistic dynamics may come into play later as the recovered population, which is immune to reinfection, becomes large relative to the remaining susceptible population such that it slows the spread of infection.
With an additional assumption that the probability of the infection arising spontaneously in the population is zero, spread of the infection must be from contact with a person who already is infected, i.e. the infection cannot be transmitted by a non-infected person, then
′
f
(
t
)
c
a
n
n
o
t
b
e
f
a
s
t
e
r
t
h
a
n
k
f
(
t
)
and the differential equation,
′
f
(
t
)
=
k
f
(
t
)
, gives the upper limit of growth. Note: it is immediatly possible to imagine some rogue health care worker disposing of virus contaminated material in a way that it could infect a huge number of people, so that this assumption could be violated.
In the real world, the cumulative case data at the beginning of the epidemic will be inaccurate. All cases and contacts cannot be discovered instantly; since case data is added when it is discovered, there will be a lag in the cumulative case count as a function of time. If most all of the cases are ultimately discovered, this lag will create a smaller error relative to the current number of cases as time progresses. A consequence of this reality is that data points late in the epidemic should be more accurate. Since it only takes three points to determine a logistic function, a small subset of late points may give a more accurate curve than a data set which includes the counts early in the epidemic. A logarithmic plot of the data is useful to note when growth becomes slower than exponential.
Model Assumptions and Derivation
1. Quarantine measures provide the only method for control of infection spread, such that there can be a maximum number of infected persons, L, which is less than the total susceptible population.
1a. 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 #1a are false.
2. The maximum growth rate of the number infected is a function of the number infected at that time, i.e.
′
f
(
t
)
k
f
(
t
)
. See the discussion in the section, “Why the Model Works”.
2a. 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.
4. Quarantine methods can establish a quarantine state for a set, Q, of the population at risk, which completely contains the set, L, of all the people who will be infected by the epidemic outbreak. The set L has a finite size which limits the spread of the epidemic. Refer to section, “Why the Model Works”.
5. The differential equation for exponential growth,
′
f
(
t
)
k
f
(
t
)
, needs a modification for quarantine methods. In a quarantine an instantaneous transmission of the virus from infected person, A, to a non-infected person B, may not happen. So the equation is modified.
′
f
(
t
)
k
f
(
t
)
P
(
t
)
Where P(t) is an instantaneous probability at time, t, that the transmission will occur. The range of P(t) is between 0 and 1. Given the assumptions above, P(t) is the probability generated by a survival function,
P
(
t
)
1
-
f
(
t
)
L
,
where L exists as a limit. This multiplier, P(t), functionally reduces k, the growth rate, toward zero as f(t) approaches L
Completing the substitution yields the logistic differential equation.
′
f
(
t
)
k
f
(
t
)
1
-
f
(
t
)
L
6. In the real world the the exponential growth of the infected population and the quarantine operations are going on simultaneously and competing with each other. Initially the quarantine is incomplete. As cases are put into the quarantine set, Q, the growth rate of the infection may be slowed, but it will not have a limit. Once the quarantine set, Q, fully contains L, all the people who can be infected, the epidemic theoretically is guaranteed to end in the future, and new cases should only arise within Q. Cases in the set, L, become countable only when a diagnosis is made by laboratory test or clinical conditions. The diagnosis cannot be made until after an incubation period, after which symptoms develop and virus particles are released from cells into secretions.
The accumulated case count, f(t), given in the data from an epidemic represents the information flow from the epidemic at time, t. Thus f(t) lags the actual state of the epidemic at time, t, because of the delay in diagnosis. Once the set L is fully contained by Q, the growth rate is fully controlled by the logistic function rather than the exponential function. This is true even if L cannot yet be fully counted. The case counts are cumulative; after L is contained, the data points should be expected to more accurately fit the logistic function.
Application of the Logistic Model to Actual Data
Procedures
I
n
[
]
:
=
C
l
e
a
r
[
m
o
d
e
l
F
i
t
D
i
s
p
l
a
y
]
;
m
o
d
e
l
F
i
t
D
i
s
p
l
a
y
[
N
L
M
_
,
d
a
t
a
_
,
o
p
t
s
_
_
_
]
:
=
M
o
d
u
l
e
[
{
b
a
n
d
s
,
p
0
,
p
1
}
,
b
a
n
d
s
[
t
_
]
=
N
L
M
[
"
S
i
n
g
l
e
P
r
e
d
i
c
t
i
o
n
B
a
n
d
s
"
,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ived from the JHU CSSE database for South Korea. The day numbers on the abscissa are based on day one being 22 January 2020, which is the first data day of database. The first 29 days from the data represented 31 accumulated cases, which had not shown any growth, these were dropped and 31 was subtracted from the accumulated cases. The data thus represent the outbreak which began in South Korea on February 19, 2020, and showed up in the database the next day. The logarithmic plot below shows the data becoming concave downward after the first three points, which show exponential growth.
O
u
t
[
]
=
The NonlinearModelFit to the logistic function is shown below. The graph is shown with 95% confidence interval along with the data points.
s
k
o
r
e
a
N
L
M
1
=
N
o
n
l
i
n
e
a
r
M
o
d
e
l
F
i
t
[
s
k
2
,
l
o
g
i
s
t
i
c
,
{
{
k
,
0
.
3
}
,
{
L
,
1
0
0
0
0
}
,
{
t
0
,
5
0
}
}
,
t
]
;
s
k
p
a
r
m
=
s
k
o
r
e
a
N
L
M
1
[
"
B
e
s
t
F
i
t
P
a
r
a
m
e
t
e
r
s
"
]
m
o
d
e
l
F
i
t
D
i
s
p
l
a
y
[
s
k
o
r
e
a
N
L
M
1
,
s
k
2
,
F
r
a
m
e
T
r
u
e
,
F
r
a
m
e
L
a
b
e
l
{
"
D
a
y
N
u
m
b
e
r
"
,
"
C
u
m
u
l
a
t
i
v
e
C
a
s
e
s
"
}
,
P
l
o
t
L
a
b
e
l
"
S
o
u
t
h
K
o
r
e
a
C
a
s
e
s
"
,
P
l
o
t
R
a
n
g
e
{
{
s
k
2
[
[
1
]
]
[
[
1
]
]
-
5
,
s
k
2
[
[
-
1
]
]
[
[
1
]
]
+
5
}
,
A
l
l
}
]
T
h
e
n
e
x
t
g
r
a
p
h
s
h
o
w
s
t
h
e
f
i
r
s
t
a
n
d
s
e
c
o
n
d
d
e
r
i
v
a
t
i
v
e
s
o
f
t
h
e
l
o
g
i
s
t
i
c
f
u
n
c
t
i
o
n
a
b
o
v
e
.
T
h
e
p
e
a
k
o
f
t
h
e
e
p
i
d
e
m
i
c
o
c
c
u
r
s
w
h
e
n
t
h
e
s
e
c
o
n
d
d
e
r
i
v
a
t
i
v
e
c
u
r
v
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ting with day 4 of the data set. By day number 43, after just 14 data points, the parameters begin to show convergence to a stable solution. At this point, L can be reasonably estimated and the epidemic should end as the number of cases approaches L. The convergence, to a stable logistic solution suggests the the quarantine measures have succeeded and the epidemic is in the logistic phase in South Korea.
O
u
t
[
]
=
With the parameters converging, the duration of the epidemic can be calculated in days.
2
L
o
g
[
-
1
+
L
]
k
/
.
s
k
o
r
e
a
N
L
M
1
@
"
B
e
s
t
F
i
t
P
a
r
a
m
e
t
e
r
s
"
/
/
C
e
i
l
i
n
g
O
u
t
[
]
=
5
3
Estimated epidemic start and end dates from the logistic function equation, rather than the derivative equation, which was used for last case date.
s
k
D
a
t
e
s
=
e
p
i
d
e
m
i
c
D
a
t
e
s
[
s
k
o
r
e
a
N
L
M
1
]
O
u
t
[
]
=
{
{
2
0
2
0
,
2
,
4
}
,
{
2
0
2
0
,
3
,
2
9
}
}
Here is another potentially useful graphic. This shows the daily differences of the natural logarithm of the daily case number. The actual log differences from the data are in orange and the predicted values from the parameter fit to the logistic model are in blue. With the epidemic in control they are clearly converging. With exponential growth, the orange points would be in a horizontal line at the growth rate. Bad data points tend to vary widely.
O
u
t
[
]
=
P
r
e
d
i
c
t
e
d
A
c
t
u
a
l
The data can also be fit to the model using the logistic differential equation. To do this a method is needed to calculate the first derivative from the data. In the graphics below the Interpolation function is used with InterpolationOrder
{1, 2, 3} sequentially. The default Method
“Spline” is used to to give a continuous derivative function. The red dots are the first derivative points calculated at the data point; note that they change with different interpolation orders so that the method may not be very precise.
P
r
i
n
t
[
l
o
g
i
s
t
i
c
D
E
F
i
t
[
s
k
2
,
0
.
3
,
9
0
0
0
,
T
r
u
e
,
I
n
t
e
r
p
o
l
a
t
i
o
n
O
r
d
e
r
#
]
]
&
/
@
R
a
n
g
e
[
3
]
;
The South Korean data are rather ideal compared to most of the data sets. The log plot of the early data from Washington state is shown below. The first five points seem to be growing exponentially; the next five points also seem exponential at a slower rate. Finally the last five points begin to show a pattern consistent with the logistic model.
O
u
t
[
]
=
This could be a case of data collection lagging at the onset of the outbreak, with old cases being discovered at an exponential rate, well after they actually occurred. The next graph shows the fit to the logistic model using all 15 data points.
w
a
N
L
M
=
N
o
n
l
i
n
e
a
r
M
o
d
e
l
F
i
t
[
w
a
,
l
o
g
i
s
t
i
c
,
{
{
k
,
0
.
3
}
,
{
L
,
1
0
0
0
}
,
{
t
0
,
6
0
}
}
,
t
]
;
w
a
N
L
M
@
"
B
e
s
t
F
i
t
P
a
r
a
m
e
t
e
r
s
"
m
o
d
e
l
F
i
t
D
i
s
p
l
a
y
[
w
a
N
L
M
,
w
a
,
P
l
o
t
R
a
n
g
e
{
{
w
a
[
[
1
]
]
[
[
1
]
]
-
2
,
w
a
[
[
-
1
]
]
[
[
1
]
]
+
5
}
,
A
l
l
}
,
P
l
o
t
L
a
b
e
l
"
W
a
s
h
i
n
g
t
o
n
F
i
t
1
5
P
o
i
n
t
s
"
,
F
r
a
m
e
T
r
u
e
,
F
r
a
m
e
L
a
b
e
l
{
"
D
a
y
N
u
m
b
e
r
"
,
"
C
a
s
e
s
"
}
]
When the fit is made with the last five points, the L parameter is lower. It is reasonable to expect more accurate parameter estimates going forward, if analysis starts with the later points, which contain all the cumulative information since the onset. At this point it is too soon to make reasonable projections.
w
a
N
L
M
=
N
o
n
l
i
n
e
a
r
M
o
d
e
l
F
i
t
[
T
a
k
e
[
w
a
,
-
5
]
,
l
o
g
i
s
t
i
c
,
{
{
k
,
0
.
3
}
,
{
L
,
1
0
0
0
}
,
{
t
0
,
6
0
}
}
,
t
]
;
w
a
N
L
M
@
"
B
e
s
t
F
i
t
P
a
r
a
m
e
t
e
r
s
"
m
o
d
e
l
F
i
t
D
i
s
p
l
a
y
[
w
a
N
L
M
,
T
a
k
e
[
w
a
,
-
5
]
,
P
l
o
t
R
a
n
g
e
{
{
w
a
[
[
1
]
]
[
[
1
]
]
-
2
,
w
a
[
[
-
1
]
]
[
[
1
]
]
+
5
}
,
A
l
l
}
,
P
l
o
t
L
a
b
e
l
"
W
a
s
h
i
n
g
t
o
n
F
i
t
L
a
s
t
5
P
o
i
n
t
s
"
,
F
r
a
m
e
T
r
u
e
,
F
r
a
m
e
L
a
b
e
l
{
"
D
a
y
N
u
m
b
e
r
"
,
"
C
a
s
e
s
"
}
]
The log plot of the Italian outbreak is below.
O
u
t
[
]
=
The differences of daily Log[cases], model and actual data are below. At this point Italy may be just starting to control the epidemic, a few more data points are needed to establish this.
i
t
N
L
M
=
N
o
n
l
i
n
e
a
r
M
o
d
e
l
F
i
t
[
i
t
,
l
o
g
i
s
t
i
c
,
{
{
k
,
0
.
2
}
,
{
L
,
2
5
0
0
0
}
,
{
t
0
,
7
0
}
}
,
t
]
;
i
t
D
a
t
e
s
=
e
p
i
d
e
m
i
c
D
a
t
e
s
[
i
t
N
L
M
]
d
t
l
i
s
t
=
D
a
t
e
R
a
n
g
e
[
D
a
t
e
P
l
u
s
[
{
2
0
2
0
,
1
,
2
1
}
,
i
t
[
[
2
]
]
[
[
1
]
]
]
,
i
t
D
a
t
e
s
[
[
2
]
]
]
;
D
a
t
e
L
i
s
t
P
l
o
t
[
{
T
r
a
n
s
p
o
s
e
[
{
d
t
l
i
s
t
,
D
i
f
f
e
r
e
n
c
e
s
@
L
o
g
[
i
t
N
L
M
[
#
]
&
/
@
R
a
n
g
e
[
i
t
[
[
1
]
]
[
[
1
]
]
,
D
a
t
e
D
i
f
f
e
r
e
n
c
e
[
{
2
0
2
0
,
1
,
2
1
}
,
i
t
D
a
t
e
s
[
[
2
]
]
]
[
[
1
]
]
]
]
}
]
,
T
r
a
n
s
p
o
s
e
[
{
T
a
k
e
[
d
t
l
i
s
t
,
L
e
n
g
t
h
@
i
t
-
1
]
,
D
i
f
f
e
r
e
n
c
e
s
@
L
o
g
@
i
t
[
[
A
l
l
,
2
]
]
}
]
}
,
J
o
i
n
e
d
F
a
l
s
e
,
F
r
a
m
e
T
r
u
e
,
F
r
a
m
e
L
a
b
e
l
{
N
o
n
e
,
"
D
a
i
l
y
D
i
f
f
e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