WolframAlpha.com
WolframCloud.com
All Sites & Public Resources...
Products & Services
Wolfram|One
Mathematica
Wolfram|Alpha Notebook Edition
Programming Lab
Finance Platform
SystemModeler
Wolfram Player
Wolfram Engine
WolframScript
Enterprise Private Cloud
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
Premier Service
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
Join
Sign In
Dashboard
Groups
People
Message Boards
Answer
(
Unmark
)
Mark as an Answer
GROUPS:
Staff Picks
Biological Sciences
Data Science
Medical Sciences
Curated Data
Graphics and Visualization
Wolfram Language
Modeling
Statistics and Probability
6
Diego Ramos
Logistic growth model for epidemic Covid-19 in Colombia
Diego Ramos, Universidad del Valle
Posted
3 months ago
1566 Views
|
1 Reply
|
6 Total Likes
Follow this post
|
MODERATOR NOTE: coronavirus resources & updates:
https://wolfr.am/coronavirus
Logistic growth model applied to the Covid-19 epidemic in Colombia
Diego Ramos
Universidad del Valle
This notebook is a computational essay using a package that can be downloaded at
https://www.wolframcloud.com/obj/diego.ramos/Published/DatosCovidINS.wl.nb
◼
The package must be saved in the same directory as the notebook in order for it to be loaded automatically as part of
initialization
.
◼
Methods
In this study we use the logistic function, first introduced in 1838 by the Belgian mathematician Verhulst and today with many applications in biology, epidemiology, statistics, machine learning, among other fields (see
[2]
and
[3]
). Verhulst introduced this function to model human populations under the thesis that in a territory of limited size and resources the number of inhabitants tends to stabilize at a maximum value that he called “carrying capacity” (see
[1]
). This model has been used in various biological populations and is known as the logistic growth model.
The logistic function is suitable for modeling many growth variables under environmental constraints. Just as population growth is limited by the size and resources of the territory, the spread of an epidemic can be limited through diagnostic systems and quarantine controls.
The logistic model can be expressed in the form of a logistic differential equation as
F
t
=
k
F
(
t
)
1
-
F
(
t
)
L
,
F
(
t
0
)
=
L
2
,
(
1
)
where
F
(
t
)
, the cumulative count of individuals infected by COVID-19, is a function of time and can be expressed in terms of the parameters
β
=
(
L
,
t
0
,
k
)
as the function Logistics
F
(
t
)
=
L
1
+
-
k
(
t
-
t
0
)
.
(
2
)
The parameter L represents the carrying capacity or maximum number of infections,
t
0
represents the instant when
F
(
t
0
)
=
L
/
2
or peak of the epidemic and k represents the relative growth rate o velocity of propagation.
The duration of the epidemic, in days, is defined as the length of the time interval
[
t
1
,
t
2
]
, where
t
1
<
t
2
and
F
'
(
t
1
)
=
F
'
(
t
2
)
=
1
(véase [6]), and it can be expressed as
d
u
r
a
c
i
ó
n
d
e
l
a
e
p
i
d
e
m
i
a
=
1
k
L
o
g
-
2
+
2
k
L
+
k
L
(
-
4
+
k
L
)
-
2
+
2
k
L
-
k
L
(
-
4
+
k
L
)
(
3
)
Our purpose is to estimate the parameters
β
=
(
L
,
t
0
,
k
)
using the non-linear least squares method. However, we will not estimate model (2) directly since previous studies indicate that deterministic models for the accumulated cases have a high serial correlation in terms of error, which generates imprecision in the parameter estimates (see
[6]
and
[7]
).Instead, the model we use to estimate the parameters is the derivative
f
(
t
,
β
)
=
F
'
(
t
)
=
k
L
-
k
(
t
-
t
0
)
2
(
1
+
-
k
(
t
-
t
0
)
)
,
(
4
)
which allows us to model the daily count of new cases.
We denote by
C
the probabilistic model of the daily count of new cases :
C
=
f
(
t
,
β
)
+
ϵ
(
5
)
W
e
a
s
s
u
m
e
t
h
a
t
t
h
e
r
e
s
i
d
u
a
l
e
r
r
o
r
s
ϵ
a
r
e
i
n
d
e
p
e
n
d
e
n
t
a
n
d
i
d
e
n
t
i
c
a
l
l
y
d
i
s
t
r
i
b
u
t
e
d
r
a
n
d
o
m
v
a
r
i
a
b
l
e
s
.
W
i
t
h
t
h
e
n
o
n
-
l
i
n
e
a
r
l
e
a
s
t
s
q
u
a
r
e
s
m
e
t
h
o
d
w
e
f
i
n
d
t
h
e
o
p
t
i
m
a
l
p
a
r
a
m
e
t
e
r
β
t
h
a
t
m
i
n
i
m
i
z
e
s
t
h
e
s
u
m
o
f
t
h
e
s
q
u
a
r
e
s
o
f
t
h
e
r
e
s
i
d
u
a
l
e
r
r
o
r
s
E
(
β
)
=
∑
t
2
(
C
(
t
)
-
f
(
t
,
β
)
)
.
(
6
)
To do this we first provided adequate initial values of
β
for the Levenberg-Marquart optimization algorithm to successfully converge to the global minimum of
E
(
β
)
.
The data
Two sources were selected to make the model fit
(4)
. One of these sources is the Johns Hopkins University (JHU), whose data is taken from the
Wolfram Repository Data
(WRD), which constitutes a public resource of organized and appropriate data sets for immediate use in computing, analysis, visualization, etc. . The second source is the
National Institute of Health of Colombia
(INS), which has made the registry of cases of contagion by Covid-19 available to the public.
The data in the Wolfram Repository Data is a dataset that has various information about the pandemic. We are only interested in obtaining the data from confirmed cases found in the ‘Confirmed Cases’ column of the dataset.
We retrieve data for counting cumulative cases in Colombia:
R
e
s
o
u
r
c
e
U
p
d
a
t
e
[
"
E
p
i
d
e
m
i
c
D
a
t
a
f
o
r
N
o
v
e
l
C
o
r
o
n
a
v
i
r
u
s
C
O
V
I
D
-
1
9
"
]
/
/
Q
u
i
e
t
;
C
o
n
t
e
o
A
c
u
m
u
l
a
d
o
U
J
H
=
R
e
s
o
u
r
c
e
D
a
t
a
[
"
E
p
i
d
e
m
i
c
D
a
t
a
f
o
r
N
o
v
e
l
C
o
r
o
n
a
v
i
r
u
s
C
O
V
I
D
-
1
9
"
,
"
W
o
r
l
d
C
o
u
n
t
r
i
e
s
"
]
[
S
e
l
e
c
t
F
i
r
s
t
[
#
C
o
u
n
t
r
y
E
n
t
i
t
y
[
"
C
o
u
n
t
r
y
"
,
"
C
o
l
o
m
b
i
a
"
]
&
]
,
"
C
o
n
f
i
r
m
e
d
C
a
s
e
s
"
]
I
n
[
]
:
=
T
i
m
e
S
e
r
i
e
s
T
i
m
e
:
2
2
J
a
n
2
0
2
0
t
o
1
0
O
c
t
2
0
2
0
D
a
t
a
p
o
i
n
t
s
:
2
6
3
O
u
t
[
]
=
From the accumulated count of cases, it is possible to obtain the daily count of new cases knowing the difference of each two consecutive accumulated data.
We obtain the daily count of new cases in Colombia in the time series format:
C
o
n
t
e
o
D
i
a
r
i
o
U
J
H
=
D
i
f
f
e
r
e
n
c
e
s
[
C
o
n
t
e
o
A
c
u
m
u
l
a
d
o
U
J
H
]
I
n
[
]
:
=
T
i
m
e
S
e
r
i
e
s
T
i
m
e
:
2
3
J
a
n
2
0
2
0
t
o
1
0
O
c
t
2
0
2
0
D
a
t
a
p
o
i
n
t
s
:
2
6
2
O
u
t
[
]
=
The National Institute of Health has provided a dataset with registration of confirmed cases and programmatic access via API Socrata Open Data (SODA); The data were chosen from the column ‘FIS’ (Symptom Onset Date) as prescribed by the INS at
https://www.ins.gov.co/Noticias/Paginas/coronavirus-notas.aspx
; For those who were asymptomatic, the corresponding data was assigned to the column ‘Notification Date’. A Wolfram code package was developed that contains a set of procedures to automate the access and curation of INS data which has been incorporated into the workflow of this computational assay. The package is named
DataCovidINS.wl
which has been loaded automatically from the
initialization
section.
We obtain the daily count of new cases in Colombia with the INS data:
C
o
n
t
e
o
D
i
a
r
i
o
I
N
S
=
I
N
S
C
o
l
o
m
b
i
a
[
]
I
n
[
]
:
=
T
i
m
e
S
e
r
i
e
s
T
i
m
e
:
2
7
F
e
b
2
0
2
0
t
o
0
9
O
c
t
2
0
2
0
D
a
t
a
p
o
i
n
t
s
:
2
2
6
O
u
t
[
]
=
From the daily count of cases it is possible to obtain the accumulated count by adding cumulatively.
We cumulatively add the daily cases to obtain the accumulated count:
C
o
n
t
e
o
A
c
u
m
u
l
a
d
o
I
N
S
=
A
c
c
u
m
u
l
a
t
e
[
C
o
n
t
e
o
D
i
a
r
i
o
I
N
S
]
I
n
[
]
:
=
T
i
m
e
S
e
r
i
e
s
T
i
m
e
:
2
7
F
e
b
2
0
2
0
t
o
0
9
O
c
t
2
0
2
0
D
a
t
a
p
o
i
n
t
s
:
2
2
6
O
u
t
[
]
=
When comparing the data provided by Wolfram Repository Data and the National Institute of Health, some discrepancies were observed, which led to the fitting of the model based on each of the data sources.
We graph the cumulative count based on each of the sources:
D
a
t
e
L
i
s
t
P
l
o
t
{
C
o
n
t
e
o
A
c
u
m
u
l
a
d
o
I
N
S
,
C
o
n
t
e
o
A
c
u
m
u
l
a
d
o
U
J
H
}
,
I
n
[
]
:
=
S
o
u
r
c
e
:
I
N
S
S
o
u
r
c
e
:
U
J
H
O
u
t
[
]
=
These differences led to the fitting of the model for each of the data sources.
Model fitting at the national level
In this section we propose to estimate the parameters of the model from the data obtained in the previous section. Once the model is estimated, we use the
t
0
to estimate the date of the
peak of the epidemic
and with the parameters
k
and
L
we will estimate the duration of the epidemic, as well as the estimated date of the end of it.
Model fitting based on JHU data
In what follows, we estimate model
(4)
from UJH data. The fit was made for the daily new case count from March 2, 2020 through September 1, 2020.
Nonlinear least squares model fitting with daily count data:
C
o
l
o
m
b
i
a
M
o
d
e
l
D
i
a
r
i
o
s
U
J
H
=
N
o
n
l
i
n
e
a
r
M
o
d
e
l
F
i
t
T
i
m
e
S
e
r
i
e
s
W
i
n
d
o
w
[
C
o
n
t
e
o
D
i
a
r
i
o
U
J
H
,
{
"
2
M
a
r
2
0
2
0
"
,
"
1
S
e
p
2
0
2
0
"
}
]
[
"
V
a
l
u
e
s
"
]
,
(
-
k
(
t
-
t
0
)
k
L
)
2
(
1
+
-
k
(
t
-
t
0
)
)
,
{
{
k
,
0
.
0
7
2
}
,
{
L
,
9
0
7
0
5
2
.
4
}
,
{
t
0
,
1
3
7
.
6
5
2
}
}
,
t
I
n
[
]
:
=
F
i
t
t
e
d
M
o
d
e
l
4
3
5
1
8
.
3
-
0
.
0
5
1
8
4
3
6
(
-
1
6
5
.
3
6
2
+
t
)
2
(
1
+
-
0
.
0
5
1
8
4
3
6
1
1
)
O
u
t
[
]
=
From the
FittedModel
object that we have just obtained, we can know the results and the diagnostics of the model. For now we are interested in the values of the estimated parameters.
We extract the values of the estimated parameters of the fit:
C
o
l
o
m
b
i
a
M
o
d
e
l
D
i
a
r
i
o
s
U
J
H
[
"
B
e
s
t
F
i
t
P
a
r
a
m
e
t
e
r
s
"
]
I
n
[
]
:
=
{
k
0
.
0
5
1
8
4
3
6
,
L
8
3
9
4
1
4
.
,
t
0
1
6
5
.
3
6
2
}
O
u
t
[
]
=
Since the peak of the epidemic occurs
t
0
days after March 2 2020, we can obtain the estimated date of the peak of the epidemic by adding the date March 2, 2020
t
0
days.
We obtain the estimated date of the peak of the epidemic by adding
t
0
days to 2 Mar 2020:
D
a
t
e
O
b
j
e
c
t
[
"
2
M
a
r
2
0
2
0
"
]
+
Q
u
a
n
t
i
t
y
[
t
0
/
.
C
o
l
o
m
b
i
a
M
o
d
e
l
D
i
a
r
i
o
s
U
J
H
[
"
B
e
s
t
F
i
t
P
a
r
a
m
e
t
e
r
s
"
]
,
"
D
a
y
s
"
]
I
n
[
]
:
=
D
a
y
:
F
r
i
1
4
A
u
g
2
0
2
0
O
u
t
[
]
=
In the
Initialization
section we have defined the
duration
variable that contains the formula that represents the duration of the epidemic. Replacing the estimates of the parameters in this formula we can obtain an estimate for the duration of the epidemic.
We replace the estimated values of the parameters
k
and
L
in the formula for the duration of the epidemic:
d
u
r
a
c
i
o
n
/
.
C
o
l
o
m
b
i
a
M
o
d
e
l
D
i
a
r
i
o
s
U
J
H
[
"
B
e
s
t
F
i
t
P
a
r
a
m
e
t
e
r
s
"
]
I
n
[
]
:
=
4
1
2
.
0
4
2
O
u
t
[
]
=
As can be seen
[5]
the estimate for the end of the epidemic, in days from the first recorded date, is given by
e
n
d
o
f
e
p
i
d
e
m
i
c
=
p
e
a
k
d
a
y
+
1
2
(
d
u
r
a
c
i
ó
n
d
e
l
a
e
p
i
d
e
m
i
a
)
.
(
7
)
From this result we can obtain an estimated date for the end of the epidemic in Colombia.
We replace the parameter estimates in equation (7) and add the days to March 2, 2020:
D
a
t
e
O
b
j
e
c
t
[
"
2
M
a
r
2
0
2
0
"
]
+
Q
u
a
n
t
i
t
y
[
(
t
0
+
1
/
2
d
u
r
a
c
i
o
n
)
/
.
C
o
l
o
m
b
i
a
M
o
d
e
l
D
i
a
r
i
o
s
U
J
H
[
"
B
e
s
t
F
i
t
P
a
r
a
m
e
t
e
r
s
"
]
,
"
D
a
y
s
"
]
I
n
[
]
:
=
D
a
y
:
M
o
n
8
M
a
r
2
0
2
1
O
u
t
[
]
=
Let’s see a graphical representation of the results of the fit we have made.
We generate the confidence bands with a level of 0.95:
b
a
n
d
a
s
9
5
U
J
H
=
C
o
l
o
m
b
i
a
M
o
d
e
l
D
i
a
r
i
o
s
U
J
H
[
"
S
i
n
g
l
e
P
r
e
d
i
c
t
i
o
n
B
a
n
d
s
"
,
C
o
n
f
i
d
e
n
c
e
L
e
v
e
l
0
.
9
5
]
;
I
n
[
]
:
=
The figure below represents the fitted model and the actual data along with the 0.95 level confidence bands.
We plot the actual data, the forecast data, and the confidence bands:
D
a
t
e
L
i
s
t
P
l
o
t
E
v
a
l
u
a
t
e
@
J
o
i
n
[
{
C
o
l
o
m
b
i
a
M
o
d
e
l
D
i
a
r
i
o
s
U
J
H
[
"
D
a
t
a
"
]
}
,
T
r
a
n
s
p
o
s
e
[
T
a
b
l
e
[
F
l
a
t
t
e
n
[
{
C
o
l
o
m
b
i
a
M
o
d
e
l
D
i
a
r
i
o
s
U
J
H
[
t
]
,
b
a
n
d
a
s
9
5
U
J
H
}
]
,
{
t
,
1
1
5
+
L
e
n
g
t
h
[
C
o
l
o
m
b
i
a
M
o
d
e
l
D
i
a
r
i
o
s
U
J
H
[
"
D
a
t
a
"
]
]
}
]
]
]
,
I
n
[
]
:
=
O
u
t
[
]
=
With the fitted model that we have obtained, we can forecast the accumulated count of cases.The following is a graph for the actual and predicted running count.
We obtain a plot of the accumulated cases from the estimated parameters and the accumulated count of cases:
D
a
t
e
L
i
s
t
P
l
o
t
{
A
c
c
u
m
u
l
a
t
e
@
C
o
l
o
m
b
i
a
M
o
d
e
l
D
i
a
r
i
o
s
U
J
H
[
"
D
a
t
a
"
]
,
T
a
b
l
e
[
(
L
/
(
1
+
E
x
p
[
-
k
(
#
-
t
0
)
]
)
/
.
C
o
l
o
m
b
i
a
M
o
d
e
l
D
i
a
r
i
o
s
U
J
H
[
"
B
e
s
t
F
i
t
P
a
r
a
m
e
t
e
r
s
"
]
)
&
[
t
]
,
{
t
,
1
1
5
+
L
e
n
g
t
h
[
C
o
l
o
m
b
i
a
M
o
d
e
l
D
i
a
r
i
o
s
U
J
H
[
"
D
a
t
a
"
]
]
}
]
}
,
I
n
[
]
:
=
O
u
t
[
]
=
Model fitting based on INS data
In what follows, we fit the model
(4)
to the data corresponding to the daily count of new cases, provided by the National Institute of Health. Estimate is based on data from March 2, 2020 through Sep 1, 2020.
Nonlinear least squares model fitting with daily count data:
C
o
l
o
m
b
i
a
M
o
d
e
l
D
i
a
r
i
o
s
I
N
S
=
N
o
n
l
i
n
e
a
r
M
o
d
e
l
F
i
t
T
i
m
e
S
e
r
i
e
s
W
i
n
d
o
w
[
C
o
n
t
e
o
D
i
a
r
i
o
I
N
S
,
{
"
2
M
a
r
2
0
2
0
"
,
"
1
S
e
p
2
0
2
0
"
}
]
[
"
V
a
l
u
e
s
"
]
,
(
-
k
(
t
-
t
0
)
k
L
)
2
(
1
+
-
k
(
t
-
t
0
)
)
,
{
{
k
,
0
.
0
7
}
,
{
L
,
8
2
2
6
1
2
}
,
{
t
0
,
1
5
8
}
}
,
t
I
n
[
]
:
=
F
i
t
t
e
d
M
o
d
e
l
4
0
3
7
4
.
8
-
0
.
0
4
5
5
1
4
9
(
-
1
5
3
.
2
6
9
+
t
)
2
(
1
+
-
0
.
0
4
5
5
1
4
9
1
)
O
u
t
[
]
=
From the FittedModel object that we have just obtained, we can know the results and diagnostics of the fit. For now we are interested in the values of the estimated parameters.
We extract the values of the parameter estimates:
C
o
l
o
m
b
i
a
M
o
d
e
l
D
i
a
r
i
o
s
I
N
S
[
"
B
e
s
t
F
i
t
P
a
r
a
m
e
t
e
r
s
"
]
I
n
[
]
:
=
{
k
0
.
0
4
5
5
1
4
9
,
L
8
8
7
0
6
9
.
,
t
0
1
5
3
.
2
6
9
}
O
u
t
[
]
=
We can use the estimated
t
0
to estimate the date of the peak of the epidemic.
We add
t
0
days to March 2 2020 to estimate the peak date of the epidemic:
D
a
t
e
O
b
j
e
c
t
[
"
2
M
a
r
2
0
2
0
"
]
+
Q
u
a
n
t
i
t
y
[
t
0
/
.
C
o
l
o
m
b
i
a
M
o
d
e
l
D
i
a
r
i
o
s
I
N
S
[
"
B
e
s
t
F
i
t
P
a
r
a
m
e
t
e
r
s
"
]
,
"
D
a
y
s
"
]
I
n
[
]
:
=
D
a
y
:
S
u
n
2
A
u
g
2
0
2
0
O
u
t
[
]
=
Now we can estimate the duration of the epidemic, in days, by replacing the estimated values for the parameters in the variable
duration
.
We replace the estimated values of the parameters in the variable duration:
d
u
r
a
c
i
o
n
/
.
C
o
l
o
m
b
i
a
M
o
d
e
l
D
i
a
r
i
o
s
I
N
S
[
"
B
e
s
t
F
i
t
P
a
r
a
m
e
t
e
r
s
"
]
I
n
[
]
:
=
4
6
6
.
0
4
2
O
u
t
[
]
=
This value gives us an estimate of the duration of the epidemic in Colombia. We can estimate the date of the end of the epidemic by replacing the estimated parameters in equation (7).
We add the corresponding days to March 2, 2020 to obtain the estimate of the end of the epidemic:
D
a
t
e
O
b
j
e
c
t
[
"
2
M
a
r
2
0
2
0
"
]
+
Q
u
a
n
t
i
t
y
[
(
t
0
+
1
/
2
d
u
r
a
c
i
o
n
)
/
.
C
o
l
o
m
b
i
a
M
o
d
e
l
D
i
a
r
i
o
s
I
N
S
[
"
B
e
s
t
F
i
t
P
a
r
a
m
e
t
e
r
s
"
]
,
"
D
a
y
s
"
]
I
n
[
]
:
=
D
a
y
:
T
u
e
2
3
M
a
r
2
0
2
1
O
u
t
[
]
=
We graphically represent the results of the fit we have made.
We can generate the confidence bands with a level of 0.95 by:
b
a
n
d
a
s
9
5
I
N
S
=
C
o
l
o
m
b
i
a
M
o
d
e
l
D
i
a
r
i
o
s
I
N
S
[
"
S
i
n
g
l
e
P
r
e
d
i
c
t
i
o
n
B
a
n
d
s
"
]
;
I
n
[
]
:
=
We plot the actual data, the forecast data, and the confidence bands:
D
a
t
e
L
i
s
t
P
l
o
t
E
v
a
l
u
a
t
e
@
J
o
i
n
[
{
C
o
l
o
m
b
i
a
M
o
d
e
l
D
i
a
r
i
o
s
I
N
S
[
"
D
a
t
a
"
]
}
,
T
r
a
n
s
p
o
s
e
[
T
a
b
l
e
[
F
l
a
t
t
e
n
[
{
C
o
l
o
m
b
i
a
M
o
d
e
l
D
i
a
r
i
o
s
I
N
S
[
t
]
,
b
a
n
d
a
s
9
5
I
N
S
}
]
,
{
t
,
1
1
5
+
L
e
n
g
t
h
[
C
o
l
o
m
b
i
a
M
o
d
e
l
D
i
a
r
i
o
s
I
N
S
[
"
D
a
t
a
"
]
]
}
]
]
]
,
I
n
[
]
:
=
O
u
t
[
]
=
With the fitted model that we have obtained, we can forecast the accumulated count of cases. Here is a chart for the actual and predicted cumulative count.
We obtain a graph of the accumulated cases from the model and the data of daily cases adding accumulatively:
D
a
t
e
L
i
s
t
P
l
o
t
{
A
c
c
u
m
u
l
a
t
e
@
C
o
l
o
m
b
i
a
M
o
d
e
l
D
i
a
r
i
o
s
I
N
S
[
"
D
a
t
a
"
]
,
T
a
b
l
e
[
(
L
/
(
1
+
E
x
p
[
-
k
(
#
-
t
0
)
]
)
/
.
C
o
l
o
m
b
i
a
M
o
d
e
l
D
i
a
r
i
o
s
I
N
S
[
"
B
e
s
t
F
i
t
P
a
r
a
m
e
t
e
r
s
"
]
)
&
[
t
]
,
{
t
,
1
1
5
+
L
e
n
g
t
h
[
C
o
l
o
m
b
i
a
M
o
d
e
l
D
i
a
r
i
o
s
I
N
S
[
"
D
a
t
a
"
]
]
}
]
}
,
I
n
[
]
:
=
O
u
t
[
]
=
Model fitting for selected cities
The cities Bogotá, Cali, Medellín and Bucaramanga were selected to fit the model
(4)
. The DataCovidINS package provides the INSCiudad procedure to obtain the data corresponding to the daily count of new cases in the time series format. The procedure to make the fit to a specific city is the same as that made at the national level, which is why these adjustments are presented in the initialization section and below we only graphically show the results of such adjustment.
We plot on the same scale the curves that predict the daily count:
D
a
t
e
L
i
s
t
P
l
o
t
{
T
a
b
l
e
[
M
o
d
e
l
o
B
o
g
o
t
a
[
t
]
,
{
t
,
1
4
,
1
1
0
+
L
e
n
g
t
h
[
M
o
d
e
l
o
B
o
g
o
t
a
[
"
D
a
t
a
"
]
]
}
]
,
T
a
b
l
e
[
M
o
d
e
l
o
C
a
l
i
[
t
]
,
{
t
,
1
0
,
1
1
0
+
L
e
n
g
t
h
[
M
o
d
e
l
o
C
a
l
i
[
"
D
a
t
a
"
]
]
}
]
,
T
a
b
l
e
[
M
o
d
e
l
o
M
e
d
e
l
l
i
n
[
t
]
,
{
t
,
1
2
,
1
1
0
+
L
e
n
g
t
h
[
M
o
d
e
l
o
M
e
d
e
l
l
i
n
[
"
D
a
t
a
"
]
]
}
]
,
T
a
b
l
e
[
M
o
d
e
l
o
B
u
c
a
r
a
m
a
n
g
a
[
t
]
,
{
t
,
1
1
0
+
L
e
n
g
t
h
[
M
o
d
e
l
o
B
u
c
a
r
a
m
a
n
g
a
[
"
D
a
t
a
"
]
]
}
]
}
,
I
n
[
]
:
=
B
o
g
o
t
á
C
a
l
i
M
e
d
e
l
l
í
n
B
u
c
a
r
a
m
a
n
g
a
O
u
t
[
]
=
We graph on the same scale the logistic curves that predict the accumulated count of cases:
D
a
t
e
L
i
s
t
P
l
o
t
{
T
a
b
l
e
[
(
L
/
(
1
+
E
x
p
[
-
k
(
#
-
t
0
)
]
)
/
.
M
o
d
e
l
o
B
o
g
o
t
a
[
"
B
e
s
t
F
i
t
P
a
r
a
m
e
t
e
r
s
"
]
)
&
[
t
]
,
{
t
,
1
4
,
1
1
0
+
L
e
n
g
t
h
[
M
o
d
e
l
o
B
o
g
o
t
a
[
"
D
a
t
a
"
]
]
}
]
,
T
a
b
l
e
[
(
L
/
(
1
+
E
x
p
[
-
k
(
#
-
t
0
)
]
)
/
.
M
o
d
e
l
o
C
a
l
i
[
"
B
e
s
t
F
i
t
P
a
r
a
m
e
t
e
r
s
"
]
)
&
[
t
]
,
{
t
,
1
0
,
1
1
0
+
L
e
n
g
t
h
[
M
o
d
e
l
o
C
a
l
i
[
"
D
a
t
a
"
]
]
}
]
,
T
a
b
l
e
[
(
L
/
(
1
+
E
x
p
[
-
k
(
#
-
t
0
)
]
)
/
.
M
o
d
e
l
o
M
e
d
e
l
l
i
n
[
"
B
e
s
t
F
i
t
P
a
r
a
m
e
t
e
r
s
"
]
)
&
[
t
]
,
{
t
,
1
2
,
1
1
0
+
L
e
n
g
t
h
[
M
o
d
e
l
o
M
e
d
e
l
l
i
n
[
"
D
a
t
a
"
]
]
}
]
,
T
a
b
l
e
[
(
L
/
(
1
+
E
x
p
[
-
k
(
#
-
t
0
)
]
)
/
.
M
o
d
e
l
o
B
u
c
a
r
a
m
a
n
g
a
[
"
B
e
s
t
F
i
t
P
a
r
a
m
e
t
e
r
s
"
]
)
&
[
t
]
,
{
t
,
1
1
0
+
L
e
n
g
t
h
[
M
o
d
e
l
o
B
u
c
a
r
a
m
a
n
g
a
[
"
D
a
t
a
"
]
]
}
]
}
,
I
n
[
]
:
=
B
o
g
o
t
á
C
a
l
i
M
e
d
e
l
l
í
n
B
u
c
a
r
a
m
a
n
g
a
O
u
t
[
]
=
We present the results of each city in an interactive way :
O
u
t
[
]
=
Statistical analysis
The analysis at the national level is based on two different data sources : data from Johns Hopkins University and data from the National Institute of Health of Colombia.The same analysis was made for the cities Bogotá, Cali, Medellín and Bucaramanga based on the INS data only.
The results of fitting the model to the time series data corresponding to new cases of Covid-19 at the national level are shown:
O
u
t
[
]
=
The results of fitting the model to the time series data corresponding to new cases of Covid-19 at the selected cities:
O
u
t
[
]
=
Residual analysis
We plot the residuals vs the fitted values:
L
i
s
t
P
l
o
t
T
r
a
n
s
p
o
s
e
[
{
T
a
b
l
e
[
C
o
l
o
m
b
i
a
M
o
d
e
l
D
i
a
r
i
o
s
U
J
H
[
t
]
,
{
t
,
L
e
n
g
t
h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C
o
l
o
m
b
i
a
M
o
d
e
l
D
i
a
r
i
o
s
U
J
H
[
"
F
i
t
R
e
s
i
d
u
a
l
s
"
]
,
R
o
t
a
t
e
L
e
f
t
@
C
o
l
o
m
b
i
a
M
o
d
e
l
D
i
a
r
i
o
s
U
J
H
[
"
F
i
t
R
e
s
i
d
u
a
l
s
"
]
}
]
,
I
n
[
]
:
=
O
u
t
[
]
=
Analysis of variance
We obtain the analysis of variance for the model based on the UJH data:
T
a
b
l
a
A
n
o
v
a
[
C
o
l
o
m
b
i
a
M
o
d
e
l
D
i
a
r
i
o
s
U
J
H
]
I
n
[
]
:
=
G
L
R
S
S
M
S
E
s
t
a
d
í
s
t
i
c
o
F
V
a
l
o
r
P
M
o
d
.
3
4
.
9
9
3
1
8
×
9
1
0
1
.
6
6
4
3
9
×
9
1
0
3
9
2
.
3
6
3
3
.
4
7
5
5
3
×
-
7
8
1
0
E
r
r
o
r
1
8
1
7
.
5
5
0
7
1
×
8
1
0
4
.
1
7
1
6
6
×
6
1
0
T
o
t
.
n
o
C
o
r
r
.
1
8
4
5
.
7
4
8
2
5
×
9
1
0
T
o
t
.
C
o
r
r
.
1
8
3
3
.
6
3
1
9
×
9
1
0
O
u
t
[
]
=
We obtain the analysis of variance for the model based on the INS data:
T
a
b
l
a
A
n
o
v
a
[
C
o
l
o
m
b
i
a
M
o
d
e
l
D
i
a
r
i
o
s
I
N
S
]
I
n
[
]
:
=
G
L
R
S
S
M
S
E
s
t
a
d
í
s
t
i
c
o
F
V
a
l
o
r
P
M
o
d
.
3
5
.
3
8
0
0
6
×
9
1
0
1
.
7
9
3
3
5
×
9
1
0
2
7
6
0
.
3
5
0
.
E
r
r
o
r
1
8
1
1
.
1
5
6
4
3
×
8
1
0
6
3
8
9
1
4
.
T
o
t
.
n
o
C
o
r
r
.
1
8
4
5
.
4
9
5
7
×
9
1
0
T
o
t
.
C
o
r
r
.
1
8
3
2
.
7
5
1
6
9
×
9
1
0
O
u
t
[
]
=
We obtain the analysis of variance for the model fitted for Bogota:
T
a
b
l
a
A
n
o
v
a
[
M
o
d
e
l
o
B
o
g
o
t
a
]
I
n
[
]
:
=
G
L
R
S
S
M
S
E
s
t
a
d
í
s
t
i
c
o
F
V
a
l
o
r
P
M
o
d
.
3
5
.
8
5
6
1
9
×
8
1
0
1
.
9
5
2
0
6
×
8
1
0
1
8
6
7
.
1
6
0
.
E
r
r
o
r
1
8
1
1
.
8
6
0
9
4
×
7
1
0
1
0
2
8
1
4
.
T
o
t
.
n
o
C
o
r
r
.
1
8
4
6
.
0
4
2
2
8
×
8
1
0
T
o
t
.
C
o
r
r
.
1
8
3
3
.
1
6
3
4
8
×
8
1
0
O
u
t
[
]
=
We obtain the analysis of variance for the model fitted for Cali:
T
a
b
l
a
A
n
o
v
a
[
M
o
d
e
l
o
C
a
l
i
]
I
n
[
]
:
=
G
L
R
S
S
M
S
E
s
t
a
d
í
s
t
i
c
o
F
V
a
l
o
r
P
M
o
d
.
3
1
.
7
0
8
7
3
×
7
1
0
5
.
6
9
5
7
6
×
6
1
0
1
7
1
7
.
7
8
0
.
E
r
r
o
r
1
8
1
5
9
0
2
0
7
.
3
2
6
0
.
8
1
T
o
t
.
n
o
C
o
r
r
.
1
8
4
1
.
7
6
7
7
5
×
7
1
0
T
o
t
.
C
o
r
r
.
1
8
3
8
.
2
5
6
9
×
6
1
0
O
u
t
[
]
=
We obtain the analysis of variance for the model fitted for Medellín:
T
a
b
l
a
A
n
o
v
a
[
M
o
d
e
l
o
M
e
d
e
l
l
i
n
]
I
n
[
]
:
=
G
L
R
S
S
M
S
E
s
t
a
d
í
s
t
i
c
o
F
V
a
l
o
r
P
M
o
d
.
3
4
.
2
7
1
1
9
×
7
1
0
1
.
4
2
3
7
3
×
7
1
0
7
4
1
.
4
2
7
5
.
0
1
7
7
6
×
-
1
0
1
1
0
E
r
r
o
r
1
8
3
3
.
4
5
6
4
6
×
6
1
0
1
8
8
8
7
.
8
T
o
t
.
n
o
C
o
r
r
.
1
8
6
4
.
6
1
6
8
4
×
7
1
0
T
o
t
.
C
o
r
r
.
1
8
5
2
.
8
8
4
6
2
×
7
1
0
O
u
t
[
]
=
We obtain the analysis of variance for the model fitted for Bucaramanga:
T
a
b
l
a
A
n
o
v
a
[
M
o
d
e
l
o
B
u
c
a
r
a
m
a
n
g
a
]
I
n
[
]
:
=
G
L
R
S
S
M
S
E
s
t
a
d
í
s
t
i
c
o
F
V
a
l
o
r
P
M
o
d
.
3
2
.
1
8
1
8
×
6
1
0
7
2
7
2
6
6
.
1
3
8
2
.
8
8
3
.
8
1
7
8
8
×
-
1
1
8
1
0
E
r
r
o
r
1
7
1
8
8
3
5
2
.
6
5
1
6
.
6
8
2
T
o
t
.
n
o
C
o
r
r
.
1
7
4
2
.
2
7
0
1
5
×
6
1
0
T
o
t
.
C
o
r
r
.
1
7
3
1
.
5
5
5
0
1
×
6
1
0
O
u
t
[
]
=
Key words
Logistic Function
◼
Covid-19
◼
Nonlinear least squares method
◼
References
[1] Bacaër N. " A Short Historory of Mathematical Population Dynamics". Springer - Verlag, 2010
[2] Dmitry Kucharavy, Roland De Guio. "Application of Logistic Growth Curve". ELSEVIER, 2015.
[3] Logistic Function, Wikipedia,
https://en.wikipedia.org/wiki/Regression_analysis
.
[4] Robert Rimmer. "Logistic Model For Quarentine Controled Epidemics",
https://community.wolfram.com/groups/-/m/t/1900530
[5] Mads Bahrami y Brian Wood. "Logistic Model for COVID-19",
https://www.wolframcloud.com/obj/covid-19/Published/Logistic-Growth-Model-for-COVID-19.nb
[6] Aaron A. King, Matthieu Domenech de Celle‘s, Felicia M. G. Magpantay1 and Pejman Rohani. “Avoidable errors in the modelling of outbreaks of emerging pathogens, with special
reference to Ebola”, 2015.
[7] Christopher Y. Shen. “Logistic growth modelling of COVID-19 proliferation in China and its in ternational implications”. ELSEVIER, 2020.
Inicialization
Load the package DatosCovidINS:
S
e
t
D
i
r
e
c
t
o
r
y
[
N
o
t
e
b
o
o
k
D
i
r
e
c
t
o
r
y
[
]
]
;
G
e
t
[
"
D
a
t
o
s
C
o
v
i
d
I
N
S
.
w
l
"
]
I
n
[
]
:
=
Usage of INSCiudad:
?
I
N
S
C
i
u
d
a
d
I
n
[
]
:
=
S
y
m
b
o
l
I
N
S
C
i
u
d
a
d
[
x
]
p
r
o
p
o
r
c
i
o
n
a
e
l
c
o
n
t
e
o
d
i
a
r
i
o
d
e
c
a
s
o
s
n
u
e
v
o
s
d
e
C
o
v
i
d
-
1
9
e
n
l
a
c
i