Epidemic Modelling in Epidemiology
Epidemic Modelling in Epidemiology
Epidemic Modelling
Investigating the dierent mathematical models
employed in Epidemiology
Jason Whalley
200617509
December 13, 2013
Abstract
This project investigates the mathematical models and their relevant approaches to Epi-
demiology. Each model will be identied, explained and applied in order to ensure clarity
throughout the report and maximise understanding, accordingly.
Evaluation of each epidemic models explored in this report will include comparison to
other mathematical models and potential applications to real-life situations in order to
maintain eectiveness in assessment.
Contents
1 Introduction 1
1.1 Terminology and Denitions . . . . . . . . . . . . . . . . . . . . . . . . . . 2
2 Simple Deterministic Epidemic 4
2.1 Properties of the simple deterministic epidemic . . . . . . . . . . . . . . . 5
2.2 Infectives and Susceptibles . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.3 Analysis of the simple deterministic epidemic . . . . . . . . . . . . . . . . . 9
2.4 End of an epidemic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2.5 Epidemic Curve . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
2.6 Explaining the epidemic curve . . . . . . . . . . . . . . . . . . . . . . . . . 22
2.7 Example of a simple deterministic epidemic . . . . . . . . . . . . . . . . . 25
2.8 R Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
3 General Deterministic Epidemic 29
3.1 Notation for general deterministic epidemics . . . . . . . . . . . . . . . . . 31
3.2 Infectives, Susceptibles and Removals . . . . . . . . . . . . . . . . . . . . . 33
3.3 Relative Removal Rate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
3.4 Approximate Solution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
3.5 R Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
4 Simple Stochastic Epidemic 48
4.1 Notation for simple stochastic epidemics . . . . . . . . . . . . . . . . . . . 49
4.2 Markov chains . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
4.3 Randomness in stochastic models . . . . . . . . . . . . . . . . . . . . . . . 54
4.4 R Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
5 General Stochastic Epidemic 58
5.1 Notation for general stochastic epidemics . . . . . . . . . . . . . . . . . . . 58
5.2 Markov Chains . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
5.3 Modelling the general stochastic epidemic . . . . . . . . . . . . . . . . . . 62
i
5.4 R Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
6 Discussion 68
6.1 Simple models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
6.2 General models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
6.3 Other models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
ii
1 Introduction
This report investigates mathematical models used in Epidemiology; the corresponding
equations that enable each model to function and explains the necessity of the relevant
mathematics.
The main source for this project is Daley and Gani (1999), though the content is
outlined and evaluated in signicantly more detail. The fundamentals of Epidemiology
and the stages an epidemic model traverses are explained in order to ensure greater
understanding.
Chapter 2 and Chapter 3 introduce the simple and general deterministic models of
Epidemiology, respectively. The deterministic approach uses dierential equations which
are solved to model the epidemics.
The rst model introduced in the report is the simple deterministic model, which
assumes that individuals do not recover from an epidemic and classies all individuals in
the population as either infectives or susceptibles.
The next model introduced in the report is the general deterministic model, which
assumes that individuals can recover - but are not added back into the population as
they develop immunity. This epidemic model classies all individuals in the population
as either infectives, susceptibles and removals. Furthermore, those classied as removals
can be labeled as dead, isolated or immune individuals.
After the discussion of the deterministic models, Chapter 4 and 5 of the report intro-
duce the simple and general stochastic models of Epidemiology. The stochastic approach
uses Markov processes to model the epidemics.
Introducing the stochastic approach to Epidemiology allows for direct comparisons to
the deterministic approach; as such, the simple and general models use similar examples
in order to discuss the comparisons.
In Chapter 6, the nal chapter in this report, the fundamentals of other epidemic
models are examined, their complexity in terms of mathematics employed is outlined and
potential approaches this report could have taken - given more time - are discussed.
The software package entitled R was used throughout the report to simulate data and
1
create graphs for the relevant epidemic models. Though not all of the R code employed
in this project will be present in the report, code that is determined as unique will be at
the end of each chapter with reference to how and where it was applied. Furthermore, all
images in the report are original and, as stated before, the graphs were created using the
software package R. [9]
Multiple examples are present throughout this report, these examples will be marked
with a relevant title and a small white box will signify the end of the example, as shown
below.
= y(0)N.
Finally, it follows that
y(t) =
y(0)N
y(0) + [N y(0)]e
Nt
. (3)
Since t is present only in the denominator, it is clear that, as t , y(t) N.
Hence, all individuals in the population will eventually become infected, which will
end the epidemic.
8
2.3 Analysis of the simple deterministic epidemic
Example: Breaking down a simple deterministic epidemic into phases.
Suppose a population consists of N = 10 individuals, starting with one infective and
nine susceptibles. The simple deterministic epidemic can be broken down into dierent
phases in order to illustrate the spread of the infection.
Figure 3: Infection spreading through a small epidemic
Figure 3 shows that in Phase 1, the Alpha Infective is infecting multiple susceptibles.
These susceptibles become infectives and proceed to infect other susceptibles. However,
by Phase 3, there are three infectives spreading the infection but since the majority of
9
the population are already infectives, there are many idle infectives. In Phase 3 there are
three infectives spreading the infection and ve infectives who are idle; not infecting any
susceptibles.
Though Figure 3 shows how infection can spread through a population, it does not
show how populations mix to actually spread the infection. Since people do not stand
still forever, Figure 3 does not take into account any form of displacement, instead it
represents only how the infection spreads through a moving population.
Phase 4 occurs at time t = T
1
. Throughout this report, T
1
will denote the time that
the epidemic ends. Furthermore, T
1
will be dened mathematically later.
A
= 0.005 and the epidemic lasts until T
A
1
= 10.59 days. In comparison, Group B has
infection parameter
B
= 0.01 and the epidemic lasts until T
B
1
= 5.29 days. Furthermore,
as
A
=
1
2
B
,
this is the reason for
T
A
1
= 2T
B
1
.
13
Example: Table comparisons.
The dierence between 75% of the population starting as infectives and 90% of the
population starting as infectives is relatively minimal in terms of how long it will take for
the epidemic to end. This is due to the tails of the curve having very small epidemic
curves at t. With a population of 200 individuals, T
1
is barely shorter. Furthermore, with
50% of the population starting as infectives compared to 75% of the population starting
as infectives, again T
1
is barely shorter. Though there is a decrease of 1.1 in T
1
from
y(0) = 0.5 N to y(0) = 0.75 N as well as y(0) = 0.75 N to y(0) = 0.9 N.
With only one individual starting as infected with a population of N = 500, T
1
= 12.43.
But with ve individuals starting as infectives, T
1
= 10.81, so the four more infectives
has shortened T
1
by 13.02%. Starting with 10 infectives, compared to one, shortens T
1
by 18.68%. Evidently the number of infectives has less and less of an eect to T
1
as y(0)
increases.
This is best explained by the epidemic curve, which measures the number of occur-
rences of new infectives. When there is only one infective, it can only spread the infection
to a few individuals. However, starting with more infectives increases the range to which
the infection can be spread to susceptibles. The epidemic curve will be discussed in more
detail and dened mathematically later in the report.
Example: Table for xed .
Having xed instead of =
1
N
allows for a better comparison of how long it takes
for an epidemic to end based upon population size N and initial infectives y(0). The
following table represents the comparison with a xed = 0.02.
14
y(0) N = 25 50 100 200 500
1 12.71 7.78 4.60 2.65 1.24
5 9.13 6.09 3.77 2.24 1.08
10 7.17 5.28 3.40 2.06 1.01
0.5 x N 6.36 3.89 2.30 1.32 0.62
0.75 x N 4.16 2.79 1.75 1.05 0.51
0.9 x N 1.96 1.69 1.20 0.77 0.40
Table 2: Table for a simple deterministic epidemic with xed .
Since = 0.02, the column of N = 50 is the same as Figure 5 as =
1
N
=
1
50
= 0.02.
The table shows that with a larger population size, it takes less time for the epidemic
to infect all individuals. This is explained due to the number of infectives being greater
at some point in the epidemic which results in a higher probability of infectives coming
into contact with susceptibles quicker than in a smaller population.
Having a population of size N = 25 takes nearly 13 days for the epidemic to cease,
starting with one infective. In contrast, having a population size of N = 500 takes just
over one day for the epidemic to cease, starting with one infective.
One infective is likely to only come into contact with a few susceptibles to infect them.
These susceptibles will become infectives, and each of them will come into contact with a
few susceptibles and infect them, accordingly. This pattern will continue, and with more
infectives there is more potential to spread the infection. However, more infectives means
less susceptibles and so the infection rate per infective will begin to shrink. Even so, as
the infection rate per infective shrinks it is easier for susceptibles to become infected due
to the increasing amount of infectives in the population.
This is to be expected, the more infectives in the population, the more the infection
can spread to the susceptibles. This will, as a result, end the epidemic quicker. This is
illustrated by Figure 5.
15
Figure 5: Generations of infectives in a broken down epidemic.
At t = 0 there is only one infective, this is the Alpha Infective and is classed
as Generation 1. The alpha infective spreads the infection to three susceptibles in the
population, who become the infectives of Generation 2. The infectives of Generation 2
proceed to spread the infection to more susceptibles, yet the alpha infective is idle and
does not spread the infection further at this point in time.
The one infective in Generation 1 can infect three susceptibles. The infectives in
Generation 2 can infect two susceptibles each, with three infectives spreading the infection
and one being idle. Two of the infectives in Generation 3 infect one susceptible each, and
the remaining four Generation 3 infectives infect no susceptibles. Hence at this point in
time eight infectives are idle and only two are infecting susceptibles.
This explains how an infection rate could slow down or speed up throughout an epi-
demic. Too many idle infectives cause the infection rate to decrease. The more infectives
spreading the infection causes the infection rate to increase. A balance of these tends to
occur later in the epidemic, especially if the number of infectives overtakes the number of
susceptibles in the population.
16
2.5 Epidemic Curve
The rate of occurrence for new infectives is given by
dy
dt
, this is the Epidemic Curve.
Breaking down a simple deterministic epidemic into sections allows for the epidemic curve
to be explained before it is mathematically determined.
Example: Breaking down a simple epidemic.
In this example a simple deterministic epidemic consisting of the following variables
will be considered:
Population size: N = 200
Initial infectives: y(0) = 1
Infection parameter: = 0.005.
Then the times that the model reaches each stage in the epidemic is given by Table 3
below
Minimum Lower Quartile Median Upper Quartile Maximum
t 0 2.65 5.29 7.94 10.59
y(t) 1 13.24 100 186.76 200
Table 3: Table showing the relevant points in the epidemic divided into percentiles.
The relevant data can be used to create a graph of this simple deterministic epidemic,
shown in Figure 6 on the next page.
17
Figure 6: A graph showing the breakdown of the simple deterministic epidemic example.
This simple deterministic example lasts for t = 10.59 days, as shown by the see-through
circle in Figure 6.
Using the dotted lines to split the epidemic into four quarters, it is simple to see that
the rst and nal quarters are the times when the total number of infectives increases the
least. The total number of infectives increases by y(t) = 13.24 infectives in both these
quartiles.
However, the mid point of the epidemic occurs at time t = 5.29 days, and at this
point there are y(t) = 100 infectives in the population. Hence, in the second quarter the
total number of infectives increases by y(t) = 86.76, and it is clear that the number of
infectives rises rapidly in this quarter.
Furthermore, the second and third quarters of the epidemic are identical; so the total
number of infectives increases by y(t) = 86.76 in the third quarter as well as the second
quarter.
This is due to the epidemic curve, which will now be dened mathematically. Recall
Equation 3,
18
y(t) =
y(0)N
y(0) + [N y(0)]e
Nt
.
Since the epidemic curve is given be
dy
dt
, it is obtained by dierentiating y(t) with respect
to t, using the Quotient Rule.
The quotient rule applies when y =
u
v
, then
dy
dt
=
vu
uv
v
2
.
Applying the quotient rule to y(t) gives
u = y(0)N,
so
u
=
du
dt
= 0.
Let
v = y(0) + [N y(0)]e
Nt
,
so
v
=
dv
dt
= N[N y(0)]e
Nt
.
Applying the quotient rule to y(t) allows the equation to be dierentiated, accordingly.
It then follows that
dy
dt
=
y(0)N
2
[N y(0)]e
Nt
[y(0) + [N y(0)]e
Nt
]
2
(4)
Hence,
dy
dt
=
y(0)[N y(0)]
e
Nt
[
y(0)
N
+ [1
y(0)
N
]e
Nt
]
2
.
Taking e
Nt
inside the square bracet in the denominator as [e
1
2
Nt
]
2
allows the equation
to be rearranged to give
dy
dt
=
y(0)[N y(0)]
[
y(0)
N
e
1
2
Nt
+ e
1
2
Nt
y(0)
N
e
1
2
Nt
]
2
=
y(0)[N y(0)]
[
y(0)
N
e
1
2
Nt
+ e
1
2
Nt
y(0)
N
e
1
2
Nt
]
2
.
19
This can then be rearranged to give the following
dy
dt
=
y(0)[N y(0)]
[
1
2
e
1
2
Nt
+
1
2
e
1
2
Nt
1
2
e
1
2
Nt
+
1
2
e
1
2
Nt
+
y(0)
N
e
1
2
Nt
y(0)
N
e
1
2
Nt
]
2
.
It then follows that
dy
dt
=
y(0)[N y(0)]
[
1
2
(e
1
2
Nt
+ e
1
2
Nt
)
1
2
(1
2y(0)
N
)(e
1
2
Nt
e
1
2
Nt
)]
2
.
The hyperbolic identities are given as
cosh(x) =
1
2
(e
x
+ e
x
),
sinh(x) =
1
2
(e
x
e
x
).
Incorporating these into the equation above, and setting x =
1
2
t above gives
dy
dt
=
y(0)[N y(0)]
[cosh(
1
2
Nt) (1
2y(0)
N
sinh(
1
2
Nt)]
2
.
The equations for the number of infectives in a population, y(t), and the rate of new
infectives occurring in the population,
dy
dt
, have now been calculated.
The epidemic curve and the total number of infectives in the population can be plotted
as functions of time. Such a plot would show when the number of infectives overtakes the
number of susceptibles in the population and show how many new infectives there are in
the population at any point in time.
Example: Illustrating the epidemic curve and number of infectives in a population.
Suppose a population consists of N = 100 individuals, starting with one infective.
Figure 7 illustrates the comparison of the number of infectives and the rate of occurrence
of new infectives on the next page.
20
Figure 7: Displaying the maximum number of new occurrences of new infectives and the
number of infectives in a simple deterministic epidemic.
Figure 7 shows that, as more individuals become infectives, the epidemic curve will
increase. This is because there are many susceptibles for the infectives to spread the
infection to, as the population is mixing homogeneously.
Furthermore, the epidemic curve is at its maximum at t = 4.60. At this time, the
value of the epidemic curve is
dy
dt
= 25 and the number of infectives is y(t) = 50.
Starting with more than one infective at t = 0 would allow for more individuals to be
infected. The initial stages and end stages of the epidemic are clearly the longest stages,
which is supported by each of the illustrated graphs in the report so far.
However, when the number of infectives is greater than the number of susceptibles, the
epidemic curve starts to decrease. The turning point of the epidemic curve occurs around
half way between t = 0 and t = T
1
. At this point in time, y(t) is approximately equal
to
1
2
N, the time where the number of susceptibles is less than the number of infectives in
the population. This is because there many infectives that are idle and not spreading the
infection to susceptibles.
As t gets closer to T
1
, the epidemic curve tends to zero.
21
2.6 Explaining the epidemic curve
To determine the time when the epidemic curve is at its maximum, Equation 3 needs to
be dierentiated with respect to t. This gives Equation 4 which needs to be dierentiated
again, however, it is simpler to dierentiate the equation by moving all of the t terms to
the denominator
dy
dt
=
N
2
[N y(0)]e
Nt
[y(0) + [N y(0)]e
Nt
]
2
=
N
2
[N y(0)]
e
Nt
[y(0) + [N y(0)]e
Nt
]
2
.
Hence
dy
dt
=
N
2
[N y(0)]
[e
1
2
Nt
y(0) + [N y(0)]e
1
2
Nt
]
2
Applying the quotient rule allows the equation to be dierentiated, accordingly; thus let
u = y(0)N
2
[N y(0)]
so
u
=
du
dt
= 0.
Now let
v =
_
e
1
2
Nt
y(0) + [N y(0)]e
1
2
Nt
_
2
so
v
=
dv
dt
= 2
_
1
2
Ne
1
2
Nt
y(0)
1
2
[N y(0)]Ne
1
2
Nt
_
_
e
1
2
Nt
y(0) +[N y(0)]e
1
2
Nt
_
,
then
v
=
_
Ny(0)
2
e
Nt
+ Ny(0)[N y(0)] Ny(0)[N y(0)] N[N y(0)]
2
e
1
2
Nt
_
,
which then becomes
v
=
_
Ny(0)
2
e
Nt
Ne
Nt
[N y(0)]
2
.
22
Since the maximum time t
m
will be obtained when
d
2
y
dt
2
= 0 and u = 0, the calculation
only requires
d
2
y
dt
2
= uv
= 0.
Hence
0 =
_
Ny(0)
2
e
Ntm
Ne
Ntm
[N y(0)]
2
[N
2
y(0)[N y(0)]],
y(0)
2
e
Ntm
= [N y(0)]
2
e
Ntm
.
It follows that
2Nt
m
= 2 ln
_
N y(0)
y(0)
_
.
This gives
t
m
=
1
N
ln
_
N y(0)
y(0)
_
.
Here t
m
is time t when the epidemic curve is at its maximum.
Example: Finding the time when the epidemic curve is at its maximum.
For this example a population of size N = 100 will be considered, consisting of y(0) = 1
infective and x(0) = 99 susceptibles at the start of the epidemic t = 0. The infection
parameter is =
1
N
and so t
m
can be equated to be
t
m
= ln
_
100 1
1
_
= ln [99] = 4.60.
So in just under ve days, the epidemic curve is at its maximum. This means that the
rate of occurrence of new infectives reaches its maximum just before ve days and then
proceeds to drop.
At time t
m
, the number of infectives is
23
y(t
m
) =
y(0)N
y(0) + [N y(0)]e
Nt
=
y(0)N
y(0) + [N y(0)]
y(0)
Ny(0)
.
It follows that
y(t
m
) =
y(0)N
y(0) + y(0)
.
Hence
y(t
m
) =
1
2
N.
This conrms the previous assertion that the epidemic curve is at its maximum when the
number of infectives is equal to half the total population. Since the population is closed,
and N = x(t) + y(t), at time t = t
m
,
N = x(t
m
) +
1
2
N.
Therefore
x(t
m
) =
1
2
N.
Thus, the rate of occurrence of new infectives is at its maximum when half of the popu-
lation are infectives and half of the population are susceptibles. It is interesting to note
that this does not depend on the infection parameter.
At time t = t
m
, the epidemic curve is
dy
dt
(t
m
) =
y(0)N
2
[N y(0)]
y(0)
Ny(0)
_
y(0) + [N y(0)]
y(0)
Ny(0)
2
=
y(0)
2
N
2
4y(0)
2
=
N
2
4
.
24
It follows that
dy
dt
(t
m
) = (
1
2
N)
2
.
Taking the simple case of =
1
N
, the epidemic curve would be
dy
dt
(t
m
) =
1
4
N.
The graph shows that the epidemic curve is at its maximum at t
m
= 0.25N.
2.7 Example of a simple deterministic epidemic
This is an example designed to explain all of the properties of a simple deterministic
epidemic this report has covered so far. Since this is a simple deterministic epidemic, it
is assumed that the population consists of only infectives and susceptibles. Moreover, an
infective remains in the infected state from 0 t T
1
, and can not change back to the
susceptible state.
The population in this example is N = 137 individuals, consisting of three infectives
and 134 susceptibles at time t = 0. Hence y(0) = 3 and x(0) = 134.
Furthermore, the infection parameter will, in this case, dier from the simple case
that has been used so far in this report. This infection in this example will not be very
infectious. The simple case was =
1
N
, but for this case = 0.003. Due to this new
being signicantly lower than
1
N
=
1
137
= 0.0073, it is safe to assume that the infection
will spread slower than that in previous cases. Hence it may take quite a few days for the
epidemic to cease.
Using the equation
T
1
=
1
N
ln
_
[N 1][N y(0)]
y(0)
_
,
inserting all of the variables allows appropriate calculation of T
1
. Hence
T
1
=
1
0.003 137
ln
_
[137 1][137 3]
3
_
,
25
T
1
= 21.20.
Hence it takes just over 21 days for all individuals in the population to be infected.
The epidemic curve is at its maximum when
t
m
=
1
N
ln
_
N y(0)
y(0)
_
.
Hence
t
m
=
1
0.003 137
ln
_
137 3
3
_
t = 9.24.
Furthermore, the corresponding epidemic curve value at this time is given by
dy
dt
=
_
1
2
N
_
2
.
It follows that
dy
dt
= 0.003
_
1
2
137
_
2
= 14.08.
Then the number of occurrences of new infectives reaches its peak at t = 9.24 days, at
which time the number of occurrences of new infectives is
dy
dt
= 14.08 each day.
The number of infectives in the population and the epidemic curve can be calculated
by inserting the variables, accordingly. Figure 8 displays the appropriate graph on the
next page.
26
Figure 8: A graph displaying the course of the simple deterministic epidemic example.
Figure 8 complies with the assertions; it takes just over 21 days for the epidemic to end
and the epidemic curve is at its maximum just after nine days. Furthermore, the number
of occurrences of new infectives is
dy
dt
14 when the epidemic curve is at its maximum.
The tail of the graph rises by one after the epidemic has ended mathematically, this
is because T
1
is given by
T
1
= inf(t : y(t) > N 1),
so the epidemic ends just as the number of infectives passes N 1.
2.8 R Code
Code from the software package R was used to illustrate several gures in this section of
the project.
Figure 6
tt=c(0:150)*0.1; beta=0.005; n=200; y0=1
y=(n*y0)/(y0+(n-y0)*exp(-beta*n*tt))
plot(tt,y,xlab="Time t",ylab="y(t)",type="l")
27
points(tt,y2,lty=3,type="l")
points(10.58660965,200,pch=1,cex=1.5)
lines(c(10.58660965,10.58660965),c(0,200),lty=2)
lines(c(5.293304825,5.293304825),c(0,200),lty=2)
lines(c(0,0),c(0,200),lty=2)
lines(c(2.646652413,2.646652413),c(0,200),lty=2)
lines(c(7.939957238,7.939957238),c(0,200),lty=2)
legend(10.5,120,c(expression(y(t)),expression(Percentiles)),lty=c(1,3),bty="n")
Figure 7
tt=c(0:150)*0.1; beta=0.01; n=100; y0=1
y=(n*y0)/(y0+(n-y0)*exp(-beta*n*tt))
plot(tt,y,xlab="Time t",ylab="y(t)",type="l")
dydt=(y0*beta*n^2*(n-y0)*exp(-beta*n*tt))/(y0+(n-y0)*exp(-beta*n*tt))^2
points(tt,dydt,lty=3,type="l")
points(4.59511985,25,pch=1,cex=1.5)
points(4.59511985,50,pch=1,cex=1.5)
lines(c(4.59511985,4.59511985),c(0,50),lty=2)
legend(10,60,c(expression(y(t)),expression(dy/dt)),lty=c(1,3),bty="n")
Figure 8
tt=c(0:300)*0.1; beta=0.003; n=137; y0=3
y=(n*y0)/(y0+(n-y0)*exp(-beta*n*tt))
plot(tt,y,xlab="Time t",ylab="y(t)",type="l")
dydt=(y0*beta*n^2*(n-y0)*exp(-beta*n*tt))/(y0+(n-y0)*exp(-beta*n*tt))^2
points(tt,dydt,lty=3,type="l")
points(9.243862558,14.07675,pch=1,cex=1.5)
points(9.243862558,68.48785799,pch=1,cex=1.5)
points(21.19679415,137,pch=19,cex=1.5)
lines(c(21.19679415,21.19679415),c(0,137),lty=2)
lines(c(9.243862558,9.243862558),c(0,68.48785799),lty=2)
legend(22,100,c(expression(y(t)),expression(dy/dt)),lty=c(1,3),bty="n")
28
3 General Deterministic Epidemic
This is an epidemic where the population consists of susceptibles, infectives and removals.
Removals are individuals who are taken out of the population.
In contrast to the simple deterministic epidemic, infectives in the general deterministic
model can change state. Infectives can change to the removal state, though susceptibles
may only change to the infective state before changing to the removal state. Thus, only
infectives can be removed from the epidemic.
Individuals can be removed from the epidemic through death, as such, lethal infections
could be modelled by the general deterministic epidemic, whereas the simple deterministic
model could not.
Though this model assumes that individuals can be removed from the epidemic at a
xed removal rate, it remains dicult to compare the general deterministic model to a
real infection as:
The model assumes that individuals continue to move around with the entire pop-
ulation in a consistent manner, instead of attempting to avoid the infection. If an
infection has noticeable symptoms, susceptibles would certainly attempt to distance
themselves from infectives and vise versa.
The introduction of removals shows that there may be potential cures for the in-
fection to create an immunity, or that it is possible to isolate individuals who are
infected. However, the model uses a xed removal parameter for this. A high num-
ber of removals at numerous points in the epidemic would be more realistic and
productive than a lower, consistent removal rate in the population.
Hence, though the general deterministic epidemic may be more applicable to real-life
situations than the simple deterministic epidemic, a model taking into account human
behaviour would be more eective.
This chapter mainly draws upon mathematics applied from Daley and Gani (1999,
p27-31), however, other sources are also drawn upon and they shall be stated at the time
the relevant mathematics is employed.
29
Example: Classication.
The general deterministic epidemic introduces Removals to the population. An indi-
vidual designated as a Removal may be classied as either dead, immune or isolated. An
immune is an individual who is not susceptible to the infection. An isolated individual is
an infected person who has been taken out of the population and will not be added again.
A dead individual is someone who has succumbed to the infection and died.
Figure 9: The classications of individuals in a general deterministic epidemic.
Figure 9 shows that an individual transfers from each state in a very tiny space of
time. From time t =
1
an individual is classied as a susceptible, but then at t =
1
+t
that same individual is classied as an infective, where t is a very small increment in
time. Hence the transfer of state from susceptible to infective is almost instantaneous, as
before.
Figure 9 illustrates every state that is part of the general deterministic epidemic.
Those classied as immune, isolated or dead are removed from the population N and
cannot be added back in. Moreover, an individual transferring from the infective state
to a state of removal (dead, immune or isolated) is almost instantaneously transferred as
30
the time is t =
2
+ t at the time of possession in all states of removal and the infective
state.
x(t).
Hence
dx
dz
=
x(t)
.
It then follows that
_
1
x(t)
dx =
1
_
dz,
ln[x(t)] =
z(t)
+ c,
where c is a constant. Taking the exponential
x(t) = e
z(t)
A,
where A = e
c
. At t = 0, x = x(0) and z(0) = 0. Imposing these initial boundary
conditions to the equations gives
x(0) = e
0
A,
34
A = x(0).
Hence the equation for x(t) is
x(t) = x(0) e
z(t)
. (6)
This implies that the equation for z(t) is
z(t) = ln
_
x(t)
x(0)
_
. (7)
This gives equations for x(t) and z(t) in terms of z(t) and x(t), respectively. Equation 5
is
N = x(t) + y(t) + z(t),
which can be rearranged to give
y(t) = N x(t) z(t)
= N x(0) e
z(t)
z(t).
Dierentiating this equation with respect to z
dy
dz
=
x(0)
z(t)
1.
Then using Equation 7
dy
dz
=
x(0)
e
ln
_
x(t)
x(0)
1
=
x(0)
x(t)
x(0)
1.
It follows that
dy
dz
=
x(t)
1.
35
3.3 Relative Removal Rate
The relative removal rate is denoted by , which determines whether there will be an
epidemic or if the infection will die out.
If the infection parameter causes the number of infectives to grow quicker than the
number of infectives which are removed from the epidemic model, then clearly there will
be an epidemic. However, if the rate at which infectives are removed from the epidemic
model is greater than the rate at which susceptibles are being infected then the infection
will die out.
At t = 0 this is the initial slope and
dy
dz
=
x(0)
> 1. Hence
x(0)
1 > 0.
The examples of each of these three cases are based on the web article by Igusa, though
this report looks at all cases and uses comparable variables; see reference [4].
Example: The case where x(0) > .
In this general deterministic epidemic example, a population will be considered con-
sisting of N = 5000 individuals. There are x(0) = 4800 susceptibles to begin with and
y(0) = 200 infectives, as well as z(0) = 0. Taking = 2500 satises the inequality
x(0) > , as 4800 > 2500. The general deterministic epidemic can be illustrated by
Figure 11 on the next page.
36
Figure 11: A graph showing the number of infectives and susceptibles in the general
deterministic epidemic as the number of removals increases, in the case of x(0) > .
In Figure 11, the general deterministic epidemic has 1000 susceptibles who have not
been infected at the end of the epidemic. At this point in time there are 4000 removals
and no infectives remaining. This is illustrated by the y curve passing through the x-axis
which signies the end of the infection (y(t) = 0).
The maximum of y(t) is given by
dy
dz
=
x(t)
1,
when
dy
dz
= 0. Since the relative removal rate = 2500 in this example, it follows that
0 =
x(t)
2500
1,
hence
x(t) = 2500.
Thus the curve for y(t) is at its maximum when x(t) = 2500. Then, the equation for z(t)
37
is given by
z(t) = ln
_
x(t)
x(0)
_
= 2500 ln
_
2500
4800
_
= 1630.81.
When z(t) = 1630.81, the number of infectives is given by
y(t) = N x(t) z(t)
= 5000 2500 1630.81
= 869.19.
Then the maximum number of infectives is displayed in Figure 11 by the see-through
circle, and is shown to occur at the same time (when the number of removals in the
epidemic is 1630.813) as when the number of infectives x(t) intersects with the line .
Furthermore the epidemic has ended without all of the susceptible succumbing to
the infection and the infectives have been removed. Though it remains that 80% of the
population were removed in some way from the population.
z(t)
,
dz
dt
=
_
N x(0) e
z(t)
z(t)
. (8)
Using the exponential approximation
e
u
1 u +
1
2
u
2
+ O(u
3
), (9)
where O(u
3
) is a small quantity of u
3
. Setting u =
z(t)
, it follows that
e
z(t)
1
z(t)
+
z(t)
2
2
.
The approximation is illustrated by the Figure 15 on the next page.
42
Figure 15: A graph that demonstrates the comparison of the exponential function e
u
and the approximation given by 1 u +
1
2
u
2
.
Figure 15 displays a comparison of e
u
and the approximation 1 u+
1
2
u
2
from Equation
9. Curve A represents e
u
and Curve B represents 1u+
1
2
u
2
. Both curves are relatively
similar until u approaches a value of 1, and when u > 1 Curve B starts to get exponentially
larger and before u = 3 it cannot be seen in the graph. However, since is usually greater
than z(t), which means that
z(t)
z(t)
2
x(0)
2
2
z(t)
_
_
N x(0) + z(t)
_
x(0)
1
_
z(t)
2
x(0)
2
2
_
.
This equation can be solved using substitution of variables multiple times. Choosing to
let
A =
x(0)
2
2
,
43
B =
x(0)
1,
and
C = N x(0),
the dierential equation can hence be written as
dz
dt
_
C + Bz(t) + Az(t)
2
_
.
It follows that
1
C + Bz(t) + Az(t)
2
dz dt,
then
_
z
z=0
1
C + Bz(t) + Az(t)
2
dz
_
t
t=0
dt. (10)
If 4ac b
2
< 0, then the following is true
_
1
ax
2
+ bx + c
=
2
b
2
4ac
tanh
1
_
2ax + b
b
2
4ac
_
.
Using the variables A, B and C that were substituted before, this can be applied to
Equation 10 by letting A = a, B = b and C = c. It follows that
4AC B
2
= 4
_
x(0)
2
2
__
N x(0)
_
_
x(0)
1
_
2
=
2
2
_
x(0)
2
2
__
N x(0)
_
_
x(0)
1
_
2
=
2x(0)
2
2
2x(0)N
2
x(0)
2
2
+
2x(0)
1
=
x(0)
2
2
2x(0)N
2
+
2x(0)
1
=
_
x(0)
2
2
1
_
+
_
2x(0)
2x(0)N
2
_
.
44
By then letting
1
=
_
x(0)
2
2
1
_
,
and
2
=
_
2x(0)
2x(0)N
2
_
.
As x(0) < N and < x(0), clearly
2x(0)
<
2x(0)N
2
. Hence
2
is negative.
Since x(0) > , it follows that x(0)
2
>
2
as x(0) 1 and x(0) is a positive integer. Hence
x(0)
2
2
1 0 but is positive.
Finally, since
2
is negative,
1
is positive and |
2
| > |
1
| as
1
0 but positive and
2
< 0,
evidently 4AC B
2
< 0.
Using the substitution of =
B
2
4AC,
=
_
2x(0)
2
_
N x(0)
_
+
_
x(0)
1
_
2
_1
2
.
After integrating the right-hand-side, accordingly, Equation 10 then becomes
tanh
1
_
2Az(t) + B
_
+
2
tanh
1
_
B
_
t.
Using a nal substitution for , where
= tanh
1
_
B
_
= tanh
1
_
1
_
x(0)
1
__
.
It follows that
tanh
1
_
2Az(t) + B
1
2
t .
Taking the inverse of tanh, multiplying both sides of the equation by 1 and then rear-
ranging allows for
2Az(t) + B
tanh
_
1
2
t
_
,
2Az(t) + B tanh
_
1
2
t
_
,
45
2Az(t) tanh
_
1
2
t
_
B.
Hence
z(t)
2A
tanh
_
1
2
t
_
B
2A
.
After substituting A, B and C back into z(t), it follows that
z(t)
2
x(0)
_
x(0)
1
_
2
x(0)
tanh
_
1
2
t
_
.
However, since
tanh(x) = tanh(x),
the approximate solution for z(t) is given by
z(t)
2
x(0)
_
x(0)
1
_
+
2
x(0)
tanh
_
1
2
t
_
.
As t , z(t) is designated as z
, so
z
lim
t
z(t)
2
x(0)
_
x(0)
1 +
_
.
This is because as t ,
2
x(0)
tanh
_
1
2
t
_
1.
As is given by
=
_
2x(0)
_
N x(0)) +
_
x(0)
1
_
2
_1
2
,
this can be rewritten as
=
_
1
2
_
2x(0)
_
N x(0)
_
+
_
x(0) )
2
__1
2
.
When 2x(0)
_
N x(0)
<<
_
x(0)
_
2
,
46
and x(0) > , it follows that
1
_
x(0)
x(0)
1.
Hence
z
2
x(0)
_
x(0)
1 +
_
2
x(0)
_
x(0)
1 +
x(0)
1
_
2
_
x(0)
_
x(0)
1
__
.
Thus
z
2
_
1
x(0)
_
.
The approximate solution for z
It is assumed that {(X, Y )(t) : T 0} is a homogeneous Markov chain, and that the
set of values the process can take are within the non-negative integers.
51
Furthermore, 0 X(t) N as the number of susceptibles ranges between the starting
amount of susceptibles and zero. Hence, I Y (t) N + I as the number of infectives
ranges between the starting amount of infectives and the total population N + I.
A property of a continuous Markov chain is that events must occur one at a time.
Then for small t:
1. Pr(X(t + t) X(t) = 1) = ijt + o(t).
2. Pr(X(t + t) X(t) > 1) = o(t).
3. Pr(X(t + t) X(t) = 0) = 1 ij + o(t).
Where, as before, is the infection parameter. These probability equations can be dened
as follows:
1. The probability of one event occurring in the time frame t is approximately equal
to ij.
2. The probability of more than one event occurring in the time frame t is approxi-
mately equal to zero.
3. The probability of no events occurring in the time frame t is approximately equal
to 1 ij.
In this simple stochastic epidemic, there are either two possible outcomes at each point
in time. First of all, an individual designated as susceptible can be infected, which then
causes them to become an infective. Hence, the number of susceptibles at time t decreases
by one and the number of infectives at time t increases by one. The other case yields zero
susceptibles being infected and so each individual stays in their current state. Thus the
following non-transitional probabilities occur after rst letting
U(t) = (X(t), Y (t)),
then
Pr{U(t + t) = (i 1, j + 1) | U(t) = (i, j)} = ijt + o(t),
52
Pr{U(t + t) = (i, j) | U(t) = (i, j)} = 1 ijt + o(t).
These equations are dened for for 0 i N and j = N + I i, where i, j are the
number of susceptibles and infectives, respectively.
The maximum number that can be achieved by infectives or susceptibles is N +I, and
only the number of infectives can reach this gure as at least one individual is initially
infected. At this point, when the number of infectives reaches N + I, this is when the
epidemic ends. Hence, U(t) = (0, N + I) is an Absorbing State.
An absorbing state is a state in a Markov chain which causes the Markov chain to
remain in that state indenitely. Figure 18 illustrates a Markov chain with an absorbing
state
Figure 18: A Markov chain with ve states, two of which are absorbing states.
In Figure 18, State E is clearly an absorbing state as there is a 100% chance that the
Markov chain will remain in State E for each transition. Hence it will remain in State E
indenitely.
This illustration can be compared to a simple stochastic epidemic. Each state rep-
resenting the number of infectives (A = 1, B = 2, ..., E = 5), with the probabilities of
infecting others increasing as the proportion of infectives in the total population increases.
The absorbing state for a simple stochastic epidemic will be the state where the total
population consists of only infectives, and no susceptibles. Hence, U(t) = (0, N + I) is
an absorbing state.
53
4.3 Randomness in stochastic models
Example: Using R to calculate a simple stochastic epidemic.
A simple stochastic epidemic takes randomness into account when determining the
path of a random walk. Using R, the random walk can be calculated by dening the
relevant variables. The path of an epidemic consisting of N +I = 25 individuals, N = 24
initial susceptibles and I = 1 initial infectives, along with an infection parameter of
= 0.04 is illustrated in Table 4.
Time = t X(t) Y(t) Time = t X(t) Y(t)
2.51 23 2 4.58 11 14
2.545 22 3 4.64 10 15
2.547 21 4 4.83 9 16
2.98 20 5 4.94 8 17
3.27 19 6 5.07 7 18
3.39 18 7 5.55 6 19
3.56 17 8 5.67 5 20
4.13 16 9 5.710 4 21
4.19 15 10 5.712 3 22
4.31 14 11 5.99 2 23
4.42 13 12 6.36 1 24
4.49 12 13 7.24 0 25
Table 4: Table illustrating the length of time between the epidemic infecting people
individually.
As illustrated by Table 4, the simple stochastic epidemic epidemic lasts for t = 7.24
days. With an initial 24 susceptibles and one infective, along with an infection parameter
of = 0.04, the simple deterministic model calculates that the epidemic lasts for t = 6.36
days. Yet the simple stochastic model calculates that the epidemic lasts for t = 7.24 days.
This is because the simple stochastic model takes randomness into account, unlike the
simple deterministic model.
54
The simple stochastic epidemic outlined in Table 4 is illustrated as a graph in Figure
19 below.
Figure 19: Graph for the simple stochastic epidemic outlined in Table 4.
The vertical dotted lines represent the jump from one integer to the next. As expected,
it takes longest for the rst susceptible and the last susceptible to become infectives.
It is possible to see from the graph how long the epidemic lasts, and the length in
time it takes for susceptibles to become infectives. Figure 19 complies with Table 4; the
simple stochastic epidemic lasts for t = 7.24.
With a larger population, it is likely that the time taken for the epidemics to cease
would be closer. Running two more simulations consisting of 199 susceptibles and one
infective initially, and an infection parameter of = 0.005, the simulated times for the
end of the epidemics are 9.76 and 8.40.
4.4 R Code
Code from the software package R was used to illustrate several gures in this section of
the project.
Table 4
This code was used to generate the relevant data for Table 4 in R.
56
nn=24; deltat=0.0001; beta=0.04
y=1; x=nn; tt=0
while (x>0) {
tt=tt+deltat
pxy=beta*x*y*deltat
k=sample(c(1,2),1,prob=c(pxy,1-pxy))
if (k == 1) {x=x-1; y=y+1}
if (k != 2) cat(tt,x,y,"n")
}
Figure 19
beta=0.04; nn=24; y=1; x=nn; tt=0
tevent=numeric(0)
kevent=numeric(0)
while(x>0){
pxy=beta*x*y; lambda=pxy; u=rexp(1,lambda)
tt=tt+u
k=sample(c(1),1,prob=c(pxy))
if (k == 1){x=x-1; y=y+1}
if (k != 2) cat(tt,x,y,"n")
tevent=c(tevent,tt)
kevent=c(kevent,k)
}
plot(0,0,type="n",xlim=c(0,tt),ylim=c(0,28),xlab="Time t",ylab="Number")
legend(0,29,c(expression(X(t)),expression(Y(t))),lty=c(1,2),bty="n")
lty=(c(1,2),bty="n")
n=length(tevent)
xx=nn; yy=1
lines(c(0,tevent[1]),c(xx,xx),lty=1)
lines(c(0,tevent[1]),c(yy,yy),lty=2)
for (i in 1:n){
if (kevent[i] == 1){
lines(c(tevent[i],tevent[i]),c(xx,xx-1),lty=3);xx=xx-1
lines(c(tevent[i],tevent[i]),c(yy,yy+1),lty=3);yy=yy+1
}
if (kevent[i] == 2){
lines(c(tevent[i],tevent[i]),c(yy,yy-1),lty=3);yy=yy-1}
if (i != n){
lines(c(tevent[i],tevent[i+1]),c(xx,xx),lty=1)
lines(c(tevent[i],tevent[i+1]),c(yy,yy),lty=2)
}
}
57
5 General Stochastic Epidemic
The general stochastic model is an epidemic where the population consists of infectives,
susceptibles and removals. This model will be in continuous time, along with the simple
stochastic model, and assumes that all individuals in the population mix homogeneously.
Infectives can be removed from the total population in this model, as with the gen-
eral deterministic epidemic; such individuals are called removals. Once an individual is
removed from the total population, that individual is removed for the duration of the
epidemic. Individuals can be removed from the epidemic through death, isolation and
immunity.
The general stochastic epidemic is very similar to the general deterministic epidemic,
though this model takes randomness into account.
It is a random time when an event occurs in a stochastic epidemic. The number of
infectives can increase (by a susceptible succumbing to the infection) or decrease (by an
infective being removed from the population group) in the general stochastic epidemic
model, so there are multiple ways for the epidemic to end.
The increase or decrease will always be by an integer of one, though the dierence in
time between each event occurring will vary.
Multiple simulations of the general stochastic epidemic will be run throughout this
chapter of the report. However since randomness is taken into account in this model, the
simulations will be unique, and this is also shown, accordingly.
This chapter mainly uses mathematics applied from Daley and Gani (1999, p66-67)
but with the content applied in signicantly more detail.
5.1 Notation for general stochastic epidemics
This epidemic model introduces mathematics similar to that employed in the simple
stochastic model. But the mathematics used in the general deterministic model is rela-
tively dierent, even though both models include removals. However, the notation will be
kept relatively similar, if possible, in order to make valid comparisons to the deterministic
model and maintain consistency.
58
Notation for general stochastic epidemics:
N: Initial number of susceptibles
I: Initial number of infectives
X(t): Number of susceptibles at time t
Y (t): Number of infectives at time t
Z(t): Number of removals at time t
Hence the general stochastic epidemic uses similar notation to the simple stochastic epi-
demic, albeit with the inclusion of removals. The total population for the general stochas-
tic epidemic is given as N + I as there are no removals at the start of the epidemic. The
total population N + I is a closed integer, and is given by
X(t) + Y (t) + Z(t) = N + I (12)
The epidemic must start with at least one infective, otherwise there would be no epidemic
to begin with as the infection could not spread. Furthermore, it is assumed that there
are no removals to start with, as including a removal to start is impractical in this model.
Hence the initial conditions are X(0) = N, Y (0) = I and Z(0) = 0, and I 1, for all
t 0.
5.2 Markov Chains
For the general stochastic epidemic, a Markov chain has multiple options in terms of state
transferral and corresponding probabilities.
The number of infectives could increase by one, which would move the Markov chain
to one state higher, with probability p
i
. The number of infectives could stay the same,
so the Markov chain would retain its place in the same state, with probability q
i
. Or the
number of infectives could increase by one, which would move the Markov chain to one
state lower, with probability r
i
. This applies for any number of processes i = 1, 2, 3, ...
where i is a non-negative integer.
59
Information on the fundamentals of Markov Chains and their appropriate properties
can be found in Isaacson and Madsen (1976) and Hoel, Port and Stone (1972), as well as
the web article from Ephraim and Mark [6].
Example: General stochastic Markov chain.
A Markov chain representing a general stochastic epidemic model could look like Figure
20 below.
Figure 20: A Markov chain representing a general stochastic epidemic, with
corresponding transitional probabilities.
Each state in Figure 20 represents the number of infectives in the total population. As
the number of infectives increases, p
i
will become larger as there will be more chance of
infectives spreading the infection to susceptibles. Though towards the end of the epidemic
p
i
will decrease.
Figure 20 shows only six states, though the Markov chain could be representative of
a very high number of individuals; there could be 500,000 individuals in a population
group, or even more.
State 0 is clearly an absorbing state. When there are no infectives in the population
there can be no epidemic and, as such, the Markov chain will remain in State 0 indenitely.
This example is based on a similar example from the web article by Iglesia [5]. This
article explains transitional probabilities in more detail and is the inspiration for Figure
20 and Figure 21.
Figure 21 shows a potential path for a Markov chain if a general stochastic epidemic
starts with one infective. This is illustrated on the next page.
60
Figure 21: The path of a general stochastic epidemic.
Figure 21 shows how the number of infectives continues to increase as a result of the
stochastic process. The number of infectives peaks at Y (t) = 7, which is when t = T
12
.
T
x
is the measured time unit, and though this graph shows the dierence in time between
each transition to be the same, this is not the case in an actual epidemic. Hence
T
2
T
1
= T
3
T
2
.
=
0.5
0.0002
= 2500.
Hence the parameters are in compliance with the requirements for the deterministic epi-
demic example.
The general deterministic epidemic can be illustrated by the graph below.
Figure 22: Showing the number of infectives and susceptibles in the general
deterministic epidemic as the number of removals increases, in the case of x(0) > .
The general deterministic model shows that the epidemic ceases as the number of
63
removals reaches 4000. The general stochastic model is illustrated by Figure 23 and
compared with Figure 22 below.
Figure 23: Showing the number of infectives and susceptibles in the general stochastic
epidemic.
Figure 22 is a function of the number of removals z(t), whereas Figure 23 is a function
of time t. Even though the graphs look slightly dierent, this is due to the x-axis being
dierent.
Though a total of 4000 individuals in the population were infected at some point in
time, there maximum number of infectives at any given time was 1000. This occurred at
around t = 7 days.
However, it is possible to see that in both graphs, the number of susceptibles at the
end of the epidemic is 1000. Hence there are 4000 removals in the epidemic. Thus,
X(T
1
) = 1000, Y (T
1
) = 0 and Z(T
1
) = 4000, where T
1
is the time that the epidemic ends.
In this case of this example, T
1
40.
This is a very large population size and, as such, it is very dicult to see the transitions
in the Markov process. Figure 24 provides a close up of the general stochastic epidemic.
64
Figure 24: The start of the general stochastic epidemic example with restricted axis.
With a restricted x-axis that now ranges from 0 to 0.5 and a y-axis that ranges from
200 to 235, this makes it signicantly easier to see the transitional steps in the Markov
chain and identify where the process is at in 0 t 0.5.
In under half a day (t = 0.5), the number of infectives has increased to 235 and
continues to grow. There are multiple points in Figure 24 where it is possible to see the
infectives being removed from the epidemic; where the number of infectives decreases.
5.4 R Code
Code from the software package R was used to illustrate several gures in this section of
the project.
Figure 23
beta=(1/5000); gamma=0.5; nn=4800; y=200; x=nn; z=0; tt=0
tevent=numeric(0)
kevent=numeric(0)
while ((x>0)&(y>0)){
pxy=beta*x*y; pyz=gamma*y; lambda=pxy+pyz; u=rexp(1,lambda)
tt=tt+u
k=sample(c(1,2),1,prob=c(pxy,pyz))
if (k == 1){x=x-1; y=y+1}
if (k == 2){y=y-1; z=z+1}
tevent=c(tevent,tt)
kevent=c(kevent,k)
}
plot(0,0,type="n",xlim=c(0,tt),ylim=c(0,5000),xlab="Time t",ylab="Number")
legend(13,4000,c("Number of susceptibles X(t)", "Number of infectives Y(t)"),lty=c(1,2),bty="n")
n=length(tevent)
xx=nn; yy=200
lines(c(0,tevent[1]),c(xx,xx),lty=1)
lines(c(0,tevent[1]),c(yy,yy),lty=2)
66
for (i in 1:n){
if (kevent[i] == 1){
lines(c(tevent[i],tevent[i]),c(xx,xx-1),lty=3); xx=xx-1
lines(c(tevent[i],tevent[i]),c(yy,yy+1),lty=3); yy=yy+1
}
if (kevent[i] == 2){
lines(c(tevent[i],tevent[i]),c(yy,yy-1),lty=3); yy=yy-1}
if (i != n){
lines(c(tevent[i],tevent[i+1]),c(xx,xx),lty=1)
lines(c(tevent[i],tevent[i+1]),c(yy,yy),lty=2)
}
}
Table 6
The following code was run in R to produce the simulated data present in Table 6.
nn=4800; deltat=0.0001; beta=(1/5000); gamma=0.5
y=200; x=nn; z=0; tt=0
while ((x>0)&(y>0)){
tt=tt+deltat
pxy=beta*x*y*deltat
pyz=gamma*y*deltat
k=sample(c(1,2,3),1,prob=c(pxy,pyz,1-pxy-pyz))
if (k == 1) {x=x-1; y=y+1}
if (k == 2) {y=y-1; z=z+1}
if (k != 3) cat(tt,x,y,z,"n")
}
67
6 Discussion
This chapter of the report discusses an overview of the report and considers potential
directions the project could have taken, given more time.
The majority of the epidemic models considered in this project touch upon more
more complex models in Epidemiology. Though the simple and general models in the
deterministic and stochastic approaches give great insight on how epidemic models func-
tion, it is relatively dicult to employ them in real-life situations. Human behaviour is
a highly complex attribute, and it seems that the majority of models fail to take into
account changing patterns and appropriate actions or views that would be taken in the
event of an epidemic. Complex models that use multiple changing variables to model
human behaviour as well as the variables for the properties of the infection should t
more appropriate epidemic models with realistic paths and outcomes.
6.1 Simple models
In regards to the simple deterministic epidemic, the epidemic curve and its properties
allowed for the report to go into great detail in its qualities, mathematics and the potential
eects to population groups.
When evaluating the simple models, it becomes clear that the application to real-life
situations is relatively dicult. A real-life application would require an infection that has:
Zero symptoms, otherwise the individuals in the population would attempt to stop
the infection spreading, which is not in compliance with how the individuals in the
population mixing homogeneously.
A group with individuals that remained only with each other, otherwise the popu-
lation would not be closed.
No possible way to cure the disease. If the disease was curable then infectives would
be removed from the population by developing immunity.
Hence, the general models are more relevant to real-life situations - albeit only slightly
more relevant.
68
However, a potential direction the project could have taken would be to explain how
a population consisting of multiple dierent groups would be modelled. This direction
would have allowed for comparisons to real-life situations such as a classroom or an oce
environment.
6.2 General models
Though the general models epidemic take into account removals in a population experi-
encing an epidemic, it remains dicult to input these models into a real-life population
where an infection is present that has noticeable symptoms. The possibilities for removed
individuals in this epidemic are that:
1. They are killed as a result of the infection. However, in the case that an epidemic
is lethal enough that it can cause death, it seems likely that an immediate eort to
contain the infection is the most appropriate cause of action. This would lead the
population to isolate any suspected individuals away from those deemed healthy.
2. Isolating infectives from the general population is a sensible action. However, in
the general deterministic epidemic, individuals are removed from the epidemic at a
xed rate with a few individuals removed at a time. Yet it makes more sense to
remove large majorities of infectives at key points in time to restrict the spread of
infection. This would require adjusted infection and removal parameters at these
key points in time.
3. Immunity is an outcome that could potentially be treated as isolation.
(a) In the event that there is a cure for the infection, then it makes more sense to
cure large majorities of infectives at key points in time to restrict the spread
of infection. This is in contrast to curing a consistently small amount of indi-
viduals.
(b) In the event that there is no medical cure for the infection and that individuals
can only recover over time, then a consistently small amount of individuals
developing immunity seems likely.
69
Hence, consideration and development of these factors would allow the deterministic
models to be implemented more eectively in real-life occurrences.
Furthermore, including dierent removal parameters for the sub-classications dead,
isolated and immune would allow for adjustment of the general epidemic models according
to how advanced a group of individuals are. Designating:
1
= Death Removal Parameter
2
= Isolation Removal Parameter
3
= Immunity Removal Parameter
Hence, an epidemic occurring in an advanced society would have strong health care
and
1
may be relatively low. For the same reasons,
2
and
3
may be relatively high.
Given more time to complete the project, the report could look into detailing the
mathematics of the general deterministic model by attempting to locate the origin of the
infection. This would involve looking at the epidemic as a negative function of time and
trace the epidemic to the alpha infective if the epidemic started with multiple infectives.
6.3 Other models
This project investigated the simple and general models using the deterministic and
stochastic approaches to Epidemiology. However, there are many other models that can
be employed to eectively model populations experiencing an epidemic.
Rumour models could be considered in this project. Rumour models classify individ-
uals as ignorants, spreaders and stiers instead of susceptibles, infectives and removals,
respectively. However, when the spreaders infect an ignorant, the ignorant individual im-
mediately becomes either a spreader or a stier. A rumour model is similar to a stochastic
model, yet oers a dierent approach to Epidemiology. Thus, with more time, a rumour
model could be another epidemic model investigated in this project.
As stated before, one main issue with the models in this report is the lack of depth
into complex human behaviour taken into account. Hence, given more time, the report
could investigate such models.
70
References
[1] Brauer, F., van den Driessche, P. and Wu, J. (1945) Mathematical Epidemiology:
Mathematical Biosciences Subseries. Springer.
[2] Daley, D.J. and Gani, J. (1999) Epidemic Modelling: An Introduction. Cambridge
University Press.
[3] Hoel, P.G., Port, S.C. and Stone, C.J. (1972) Introduction to Stochastic Processes.
Houghton Miin.
[4] Internet article. Accessed 2nd November 2013.
[Link]
[5] Internet article. Accessed 23rd November 2013.
[Link]
[6] Internet article. Accessed 30th November 2013.
[Link]
[7] Isaacson, D.L. and Madsen, R.W. (1976) Markov Chains, Theory and Applications.
Wiley.
[8] Kermack, W.O. and McKendrick, A.G. (1927) A Contribution to the Mathematical
Theory of Epidemics.
[9] R Development Core Team (2011). R: A language and environment for statisti-
cal computing. R Foundation for Statistical Computing, Vienna, Austria. ISBN 3
- 900051 - 07 - 0, URL [Link]
[10] Trottier, H. and Philippe, P. (2001) Deterministic Modelling of infection diseases.
71