100% found this document useful (3 votes)
47 views75 pages

Epidemic Modelling in Epidemiology

The document describes a student project investigating mathematical models used in epidemiology. It introduces simple and general deterministic models as well as simple and general stochastic models. The deterministic models use differential equations to model epidemics while the stochastic models use Markov processes. Various terminology for epidemiology modeling is defined. Sample R code is provided for simulations.

Uploaded by

Jason Whalley
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (3 votes)
47 views75 pages

Epidemic Modelling in Epidemiology

The document describes a student project investigating mathematical models used in epidemiology. It introduces simple and general deterministic models as well as simple and general stochastic models. The deterministic models use differential equations to model epidemics while the stochastic models use Markov processes. Various terminology for epidemiology modeling is defined. Sample R code is provided for simulations.

Uploaded by

Jason Whalley
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

MATH3752: Project in Statistics

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.

1.1 Terminology and Denitions


There is a range of terminology employed throughout this report. Though the terms will
be dened at the time that they occur in the report the rst time, knowledge of them will
be assumed thereafter. Hence, the report will list some of the key terms applied at the
start in order to comply with the aim of complete clarity.
Susceptible: An individual who is not infected but is capable of becoming an infective.
Infective: An individual who is infected and capable of spreading the infection to other
individuals.
Immune: An individual who can not be infected by the infection.
Infective State: The state an individual enters once being infected. The time length of
the state and any induced eects to the individual are dependent upon the infection.
Infection Parameter: The rate at which the infection spreads throughout the popula-
tion, denoted by .
Alpha Infective: The rst infective in the population. If there are multiple infectives
in the population at t = 0 then this term will not be used.
Epidemic Curve: The curve that measures the number of occurrences of new infectives
at time t.
2
Removal Parameter: The rate at which infectives are removed from the population,
denoted by .
Relative Removal Rate: This determines whether there will be an epidemic or if the
infection will die out, denoted by .
Markov Chain: A Markov chain is a system that uses processes to transition from one
state to another.
Absorbing State: An absorbing state is a state in a Markov chain which causes the
Markov chain to remain in that state indenitely.
3
2 Simple Deterministic Epidemic
This is an epidemic where the population consists of only Infectives and Susceptibles.
Individuals designated as infectives are capable of infecting individuals designated as
susceptibles, and once a susceptible is infected they become an infective. Furthermore,
there will be no births or deaths in this model, hence the population will remain closed.
In a simple deterministic epidemic infectives remain infected and do not change from
this state. Furthermore, the infectives continue to spread the infection until the end
of the epidemic, where all individuals in the population are infected and there remains
no susceptibles. Since the infection parameter is xed throughout the epidemic, the only
outcome possible in the simple deterministic model is for all individuals to become infected
by the epidemic - no matter how long this takes.
A simple epidemic may represent an infection that is very infectious, but does not
cause any serious aictions to those infected by it. This would allow infectives and
susceptibles to mix if infectives showed little or no symptoms of the infection and, as a
result, the infection would spread.
However, it is dicult to compare the simple deterministic model to any real infection
as real people do not follow the main principles of the epidemic.
This model assumes that individuals continue to move around in a consistent man-
ner, almost as if they were ignoring the infection. Whereas, in the presence of
a noticeable infection, the uninfected individuals in a population would distance
themselves from the infectives in an eort to avoid the infection.
Another assumption is that there is no way to cure the infection. However, the
majority of infections in the real world have cures available. In the event that
there is no cure for the infection, eorts to isolate the infected individuals would
most likely be made by the individuals in the population to limit the spread of the
infection.
Hence, a favourable outlook on the simple epidemic would be to consider an infection that
has zero noticeable symptoms.
4
This section of the report mainly uses mathematics applied in Daley and Gani (1999,
p21-23) though the content is thoroughly explained in sucient detail for the report.
The number of infectives is a function of time in the deterministic epidemic models,
as well as the number of susceptibles. There are no stochastic elements considered in the
deterministic models, though stochastic models will be discussed later in the report.
2.1 Properties of the simple deterministic epidemic
The transfer of state is instantaneous, as such it only takes a small increment in time
t to transfer from one state to another. An individual transferring from the susceptible
to infective state will be instantly transferred to the new state. This is demonstrated in
Figure 1 below
Figure 1: Instantaneous state transferral.
Figure 1 shows that an individual is in the susceptible state at time t = . The
individual changes from the susceptible state to infective state and will be categorised as
an infective at t = + t.
Example: Simple deterministic epidemic consisting of four individuals.
In this example a population will be considered that consists of four individuals in a
simple deterministic epidemic. The epidemic starts with three infectives and one suscep-
tible, at time t = 0. It should be assumed that time is measured in days.
5
Figure 2: Very small simple deterministic epidemic.
Figure 2 illustrates this example. At time t = 0 there are three infectives and one
susceptible in the simple deterministic epidemic, but the infectives are spreading the
infection. By time t = 1 there are four infectives and zero susceptibles. This means that,
by time t = 1, the susceptible has been infected and is designated as an infective. Hence
the end of the epidemic occurs at after one day, t = 1.

Notation for simple deterministic epidemics:


N: Total Population
x(t): Number of susceptibles at time t
y(t): Number of infectives at time t
Let the size of the Total Population be N, which is a nite number, and the following
equation represents N for t 0,
6
N = x(t) + y(t). (1)
2.2 Infectives and Susceptibles
At t = 0, Equation 1 is x(0) + y(0) = N, but a simple deterministic epidemic must start
with at least one infective, so y(0) 1. Otherwise the total population would consist
only of susceptibles and there would be no epidemic to start with.
Now it be will assumed that the individuals in the population mix homogeneously,
which means that the entire population keeps moving around and mixing together in a
consistent way from time t = 0 until t = T
1
, almost as if the individuals in the population
are ignoring the infection. T
1
is the time designated as the end of the epidemic and
is the time where all of the individuals in the population are infectives in the simple
deterministic epidemic. Later in the report, T
1
will be dened mathematically.
Since it is assumed that the infection spreads homogeneously,
dy
dt
= x(t)y(t).
Removing x(t) or y(t) makes this simpler to solve. So choosing to remove x, since x(t) =
N y(t),
dy
dt
= y(t)[N y(t)]. (2)
The dierential equation depends on the number of infectives, the number of susceptibles
and the infection parameter. Here, is the Infection Parameter; the rate at which the
infection spreads throughout the population.
A highly infectious, common disease such as Cholera - which can be spread through
water consumption easily - may have a relatively high infection parameter (or an air-
borne disease would be likely to have a high infection parameter) when compared to an
uncommon disease with a low rate of infection.
The dierential equation, Equation 2 can be solved as follows
1
y(t)[N y(t)]
dy = dt,
7
1
N
_
1
y(t)
+
1
N y(t)
_
dy = dt.
Then integrating between 0 and t because of the boundary conditions, hence
1
N
_
t
0
_
1
y
+
1
N y
_
dy =
_
t
0
dt,
1
N
_
ln(y) ln(N y)
_
t
0
=
_
t
_
t
0
.
Hence
_
ln
_
y
N y
__
t
0
= Nt,
ln
_
y(t)
N y(t)
_
ln
_
y(0)
N y(0)
_
= Nt.
It follows that
y(t)[N y(0)]
y(0)[N y(t)]
= e
Nt
.
This rearranges to give
y(t) =
y(0)[N y(t)]e
Nt
N y(0)
.
Expanding the numerator gives
y(t) =
y(0)N
[N y(0)]e
Nt

y(0)y(t)
[N y(0)]e
Nt
,
y(t)[N y(0)]e
Nt
+ y(0)y(t)
[N y(0)]e
Nt
=
y(0)N
[N y(0)]e
Nt
,
y(t)
_
e
Nt
[N y(0)] + y(0)

= 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.

Example: Dierent infection parameters in epidemics.


The length of the epidemic, which is measured in days by time t, is dependent on
multiple variables. This example shows the eect of the infection parameter, , on the
simple deterministic epidemic. The following variables will be xed for this example:
Populaton size: N = 200
Initial Infectives: y(0) = 1.
However, one population is designated as Group A and another population is desig-
nated as Group B. The former has an infection parameter of
A
= 0.005 and the latter
has an infection parameter of
B
= 0.01. The varying values for are shown to aect the
length of the epidemic, accordingly, in Figure 4 on the next page
10
Figure 4: Length of epidemics with dierent infection parameters.
Figure 4 shows the comparison of Group A and Group B experiencing a simple deter-
ministic epidemic with dierent infection parameters. Group A has infection parameter

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
.

2.4 End of an epidemic


Since the epidemic is declared over when all individuals within the population are infec-
tives, the time that this occurs is designated as T
1
. Therefore, T
1
can be given by
T
1
= inf (t : y(t) > N 1).
Since N is an integer, the only integer greater than N 1 is N.
11
Taking T
1
= inf (t : y(t) > N
1
2
) would be acceptable, as well as any real value
between 0 and 1, yet population sizes will always be considered as integers, at least to
begin with, hence y(t) > N 1. It then follows that y(T
1
) = N 1, and so
N 1 =
y(0)N
y(0) + [N y(0)]e
NT
1
.
This equation needs to be rearranged to determine T
1
, hence
1
N 1
=
y(0) + [N y(0)]e
NT
1
y(0)N
,
so then
y(0)N
N 1
y(0) = [N y(0)]e
NT
1
.
Simplifying the left-hand-side
y(0)N y(0)N + y(0)
N 1
= [N y(0)]e
NT
1
,
then dividing by [N y(0)] gives
y(0)
[N 1][N y(0)]
= e
NT
1
.
Taking the log of both sides
ln
_
y(0)
[N 1][N y(0)]
_
= NT
1
.
Finally,
T
1
=
1
N
ln
_
[N 1][N y(0)]
y(0)
_
.
Taking =
1
N
gives a simple case where T
1
can be calculated for dierent values of N
and y(0). Table 1 illustrates this on the next page
12
y(0) N = 25 50 100 200 500
1 6.36 7.78 9.19 10.59 12.43
5 4.56 6.09 7.54 8.96 10.81
10 3.58 5.28 6.79 8.24 10.10
0.5N 3.18 3.89 4.60 5.29 6.21
0.75N 2.08 2.79 3.50 4.19 5.11
0.9N 0.98 1.69 2.40 3.10 4.02
Table 1: Table illustrating the length of time for an epidemic to end considering
dierent variables.
With a population of N = 25, the table shows shows that with 90% of the population
starting as infectives, the time for every individual in the population to be infected -
which will end the epidemic - is signicantly lower than if only one individual started as
an infective.
In addition, taking the larger population of 500 individuals, it is possible to see that it
takes three times as long for the epidemic to cease starting with one infective as opposed
to 90% of infectives.
Table 1 is inuenced by a similar table present in Daley and Gani (1999, p22).
Example: Interpreting the table.
With a population of N = 100 starting with one infective (so 99 susceptibles), reading
from the table it would take T
1
= 9.19 for the entire population to be infected. Since T
1
is measured in days, it takes just over nine days for the epidemic to cease.
A population of N = 500 individuals that starts with 250 infectives (hence also 250
susceptibles) will endure an epidemic that lasts until T
1
= 6.21, at which point the entire
population is plagued by the infection. Hence this epidemic would last for just over six
days.

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.

3.1 Notation for general deterministic epidemics


Following on from the simple deterministic epidemic, let the total population be N, which
is a nite number, and the following equation represents N for t 0,
N = x(t) + y(t) + z(t). (5)
Notation for the general deterministic epidemics:
N: Total Population
x(t): Susceptibles
y(t): Infectives
z(t): Removals
An individual dened as a removal is someone who has been taken out of the population
as a result of the infection. A removed individual may be immune, dead or isolated.
Example: Removals in a small epidemic.
When an epidemic spreads through a population, it may be potentially fatal to all of
those susceptible to the infection. Therefore, it would make sense to attempt to contain
the population. This may take a while depending on how infectious the disease is, how
many individuals are in the population and how noticeable the symptoms are.
Taking a small population of size N = 12, and shows how individuals may be removed
from the population in dierent ways.
31
Figure 10: The range of dierent types of individuals in a general deterministic epidemic.
Figure 10 is an example of a general deterministic epidemic spreading through a small
population of size N = 12. The epidemic is split into ve phases and ends at the fth
phase, where there are no more susceptibles in the population.
The epidemic starts with one infective, eleven susceptibles and zero removals. Hence,
at time t =
1
; y(
1
) = 1, x(
1
) = 11 and z(
1
) = 0.
The alpha infective spreads the infection to three other susceptibles which causes there
to be a total of four infectives by the second phase. So at time t =
2
; y(
2
) = 4, x(
2
) = 7
and z(
2
) = 0.
However, one of the infectives recovers from the infection by the third phase. Hence,
at time t =
3
; y(
3
) = 6, x(
3
) = 5 and z(
3
) = 1.
32
The infection continues to spread and at the end of the epidemic at time t = T
1
there
are two susceptibles remaining, yet there are a total of ten removals: one individual has
died, eight have been isolated from the rest of the population, and one has recovered from
the infection. Hence, by the end of the epidemic, at time t = T
1
; y(T
1
) = 0, x(T
1
) = 2
and z(T
1
) = 9.
The reason for the epidemic ending is due to isolation of the infectives. Isolating them
from the rest of the population enabled the remaining susceptibles to be out of reach
of the infection. However, there are only two susceptibles remaining at the end of the
epidemic as well as one immune individual, so the epidemic has managed to infect a large
majority of the population.
The epidemic ends with:
Eight people isolated
One person immune to the infection
One dead individual
Two people uninfected and still susceptible to the infection

3.2 Infectives, Susceptibles and Removals


At t = 0 Equation 5 becomes x(0) + y(0) + z(0) = N, and since an epidemic must start
with at least one infective, y(0) 1.
Mathematics used by Brauer, van den Driessche and Wu (1945, p22) denes the rele-
vant dierential equations that are used to describe the number of infectives, susceptibles
and removals over time.
As it is assumed that the total population consists of zero removals at t = 0, since a
removal is taken out of the population, it does not make sense to start with a population
consisting of any removals; hence z(0) = 0 at the start of the epidemic t = 0.
With the infection parameter as before, the dierential equation for x(t) is
dx
dt
= x(t)y(t).
33
It is assumed that the number of infectives increases and the number of susceptibles
decreases over time. Some susceptibles will change to infectives and some infectives will
be removed from the population as a result of death, immunity or isolation. The rate at
which infectives are taken out of the population is given by the Removal Parameter .
Hence
dy
dt
= x(t)y(t) y(t).
Furthermore, the number of removals has to increase alongside the rate of the loss of
infectives. Hence
dz
dt
= y(t).
These dierential equations are the fundamentals of the general deterministic model and
were rst employed by Kermack and McKendrick (1927); cited by Daley and Gani (1999).
Dening to be =

, the Relative Removal Rate,


dx
dz
can be given by
dx
dz
=
dx
dt

dt
dz
.
Then
dx
dz
= xy
1
y
=

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. Three cases are presented:


1. x(0) >
2. x(0) <
3. x(0) =
In the case of x(0) > , this implies that
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.

Example: The case where x(0) < .


In this example of a general deterministic epidemic a population will be considered
consisting of N = 5000 individuals. There are x(0) = 4500 susceptibles to begin with and
y(0) = 500 infectives. Taking = 5000 satises the inequality x(0) < , 4500 < 5000.
The general deterministic epidemic can be illustrated by Figure 12 on the next page.
38
Figure 12: Showing the number of infectives and susceptibles in the epidemic as the
number of removals increases, in the case of x(0) < .
In Figure 12 the number of infectives soon reaches zero, when there are z(t) = 2000
removals. In this example there are signicantly more susceptibles remaining at the end
of the epidemic. When the number of infectives reaches zero, the number of susceptibles
remaining is x(t) = 3000.
The maximum number of infectives y(t) is given at the start of the infection as the
number of infectives only decreases.
Hence this epidemic has ended without all of the susceptibles succumbing to the in-
fection. 60% of susceptibles remain at the end of the epidemic.

Example: The case where x(0) = .


In this general deterministic epidemic example, consider a population of N = 5000
individuals. There are x(0) = 4000 susceptibles to begin with and y(0) = 1000 infectives.
Taking = 4000 satises x(0) = . The general deterministic epidemic can be illustrated
by Figure 13 on the next page.
39
Figure 13: Showing the number of infectives and susceptibles in the epidemic as the
number of removals increases, in the case of x(0) = .
In Figure 13 the epidemic ends when there are z(t) 3250 removals. At this point
in time, when the infectives curve crosses the x-axis, there are x(t) 1750 susceptibles
remaining.
The maximum number of infectives is given at when x(t) = , so when x(t) = 4000.
Since the number of infectives only decreases in this example, the maximum number of
infectives is given at the start of the epidemic.
This epidemic has also ended without all of the susceptibles becoming infected. 43.75%
of the population remains uninfected by the time that the epidemic ends.

Example: x(0) < .


If x(0) < , the number of infectives is at the maximum at the start of the epidemic,
as illustrated in Figure 12 and Figure 13. An illustration of such an epidemic is displayed
by Figure 14 on the next page.
40
Figure 14: Demonstrating the course of a general deterministic epidemic with the
number of infectives greater than the relative removal rate, so x(0) < .
In this example, the population consists of N = 16 individuals. Of the 16 individuals,
there are x(0) = 13 susceptibles and y(0) = 3 infectives at the start of the epidemic.
Furthermore, in this example, individuals are classied only as removals and are not
further classied as dead, immune and isolated individuals as the model does not consider
separate parameters for each of these sub-classications.
During Phase 1 there are three infectives, two of the infectives are spreading the
infection to three susceptibles. By Phase 2, the three infectives in Phase 1 have been
removed from the population, but have spread the infection to three susceptibles.
By Phase 3, the nal stage of the epidemic, all of the infectives have been removed
from the population, without infecting any more susceptibles. Hence at the end of the
epidemic there are six removals and ten susceptibles.
41
This example of a simple deterministic epidemic could be compared to a real-life
situation as the removal parameter is clearly quite high; hence, in a real-life situation the
individuals in the population would have made eorts to isolate the infected individuals.

3.4 Approximate Solution


The approximate solution to the general deterministic model shows how many removals
are present in the epidemic as t . So, it calculates how many individuals have been
removed from the epidemic as it ends.
The approximate solution is employed if x(0) is greater than by a small amount.
Hence, for the approximate solution it will be assumed that x(0) 0 but also x(0)
is positive.
Since
dz
dt
= y(t), y(t) = N x(t) z(t) and x(t) = x(0) e

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)

< 1, the approximation is justied for use in the


equation.
Hence, Equation 8 becomes
dz
dt

_
N x(0) +
z(t)x(0)


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)

is much smaller than


_
x(0)
_
2
, then
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

has been shown, and so the number of removals can be


calculated as t tends to innity.
3.5 R Code
Code from the software package R was used to illustrate several gures in this section of
the project.
Figure 11
curve(5000-4800*exp(-x/2500)-x,0,4000,ylim=c(0,5000),xlab="z(t)",ylab="Number")
curve(4800*exp(-x/2500),add=TRUE,lty=2)
curve(2500+x*0,add=TRUE,lty=3)
points(1630.813,2500,pch=19,cex=1.5)
points(1630.813,869.187,pch=1,cex=1.5)
lines(c(1630.813,1630.813),c(0,2500),lty=1)
legend(3000,4000,c(expression(y(t)),expression(x(t)),expression(rho)),lty=c(1,2,3),bty="n")
Figure 15
curve(exp(-x),0,4,ylim=c(0,2),xlab="u",ylab="")
curve(1-x+0.5*x^2,add=TRUE,lty=2)
legend(3,1.3,c(expression(A),expression(B)),lty=c(1,2),bty="n")
47
4 Simple Stochastic Epidemic
The simple stochastic model describes the evolution of a simple model in a stochastic
process.
The deterministic models revolve around a number of functions; for example, the
number of susceptibles in a population. However, the functions in these deterministic
models are continuous, so in the deterministic model it is possible to choose a random
point in time in the epidemic and have x(t) = 4.32 susceptibles. Yet it is not possible to
infect 0.32 individuals. The person has to be infected, or not infected. In contrast to the
deterministic epidemic models, the stochastic models in this report model the functions
included in the deterministic models in discrete time. Hence, the number of infectives or
susceptibles increases of decreases by an integer.
This is an epidemic where the population consists of only infectives and susceptibles.
The model will be in continuous time and, as before with the deterministic models, once
a susceptible is transferred from the susceptible state to the infective state, the individual
remains an infective for the duration of the epidemic. Furthermore, the simple stochastic
epidemic assumes that all individuals in the population mix homogeneously.
Hence, in many ways this simple epidemic is similar to the deterministic model. How-
ever, this model takes randomness into account whereas the deterministic model does
not.
It is a random time when an event occurs in a stochastic epidemic. Since the only
transferral of state in the simple stochastic epidemic is moving from susceptible to infec-
tive, this is the only event in this epidemic model.
When the event occurs, which is when an individual becomes infected, the number of
infectives increases by one. The increase will always be an integer, which is in contrast to
the simple deterministic model which measured the number of infectives in real numbers
instead of integers.
Multiple simulations of the simple 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. The corresponding graphs
48
will also be present to show the path of the epidemics, and these relevant graphs will
contain show clearly when an event occurs by noticing an increase or decrease by one for
the number of infectives or susceptibles, respectively.
4.1 Notation for simple stochastic epidemics
This epidemic model introduces signicantly dierent mathematics to that employed pre-
viously in the report. However, the notation will be kept relatively similar, if achievable,
to make clear comparisons to the deterministic models and maintain consistency.
Notation for simple 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
The total population for a simple stochastic epidemic is N + I; this is a closed integer,
which given by
X(t) + Y (t) = N + I. (11)
The initial conditions are X(0) = N and Y (0) = I, for all t 0. As before, the epidemic
must start with at least one infective, otherwise the infection would not be able to spread
through the population and there would be no epidemic at all; hence I 1.
Example: A simple stochastic process consisting of 17 individuals.
Considering a simple stochastic process consisting of N + I = 17 individuals, with
N = 16 and I = 1, Figure 16 on the next page shows how a stochastic process is modelled.
49
Figure 16: A simple stochastic process showing how the number of infectives decreases
over time.
Figure 16 shows that the number of susceptibles starts to decrease slowly at rst, then
towards the middle of the graph the number of susceptibles rapidly descends, and towards
the end of the epidemic the number of susceptibles, once again, decreases slowly. This
is similar to a simple deterministic epidemic, which was explained by the epidemic curve
being small at the start and end of the epidemic.

4.2 Markov chains


A Markov chain is a system that uses processes to transition from one state to another.
In terms of the simple stochastic epidemic, the transferral of state only has two options
with corresponding probabilities. First of all, the number of infectives can increase, which
50
would move the Markov chain up to a higher state. The other possibility is that the
number of infectives stays the same, hence the Markov chain stays in the same state.
For more information on Markov Chains and Stochastic Processes, Isaacson and Mad-
sen (1976) and Hoel, Port and Stone (1972) extensively detail their properties and poten-
tial applications further than this report.
Example: Markov Chain.
A relatively simple Markov chain that consists of only four states is displayed in Figure
17 below
Figure 17: A Markov chain consisting of four states and relevant transitional
probabilities.
The four states A, B, C and D are represented by triangles and the arrows represent
the transitional probabilities. So in State A there is a probability of 0.3 of moving to
State B and a 0.7 probability of moving to State D.
If the Markov chain moves into State C, then it will stay in this state indenitely as
there is a 100% chance of the Markov chain retaining its current state.

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.

Example: Randomness in stochastic models.


As the simple deterministic model takes randomness into account, calculating the
epidemic again will yield dierent results. To show this, an epidemic will be calculated
in R with exactly the same variables.
Considering an epidemic consisting of ve susceptibles and one infective initially, with
an infection parameter of =
1
6
, Table 5 shows how randomness eects the calculation.
55
X(t) Y(t) t
A
t
B
4 2 2.9575 1.3987
3 3 3.2118 2.5083
2 4 3.5739 2.7128
1 5 4.8013 4.6888
0 6 9.7923 5.5641
Table 5: Table illustrating randomness in stochastic models through identical variables
being run through simulations.
Using identical variables and running the relevant R simulations yields dierent results
for multiple simulations, as shown in Table 4. In this case, t
A
is the time taken from
the start of the epidemic to the particular increment for population group A, and t
B
is
similarly for group B.
Table 5 shows that group A takes signicantly longer for the epidemic to cease, and
signicantly longer for the infection to start spreading, than group B. However, the main
dierence in time between the groups is due to the nal infective in group A taking such
a long time to become infected.

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
.

It is assumed that {(X, Y )(t) : t 0} is a bivariate Markov process. The infection


spreads at a rate of ijt for infection parameter and infectives are removed from the
total population at a rate of jt for removal parameter .
In a general stochastic epidemic, there are three possible outcomes at each point in
time:
1. First of all, an individual designated as a susceptible can be infected, which then
causes them to become an infective. Hence, the number of susceptibles at time
61
t decreases by one and the number of infectives at time t increases by one. The
number of removals does not change.
2. The next case is when an infective is removed from the population. Hence, the
number of infectives in the population is reduced by one and the number of removals
increases by one. The number of susceptibles does not change.
3. The nal case is when there are no susceptibles being infected as well as no infectives
being removed from the population. Hence the Markov chain does not change.
Thus the following non-transitional probabilities occur after again letting
U(t) = (X(t), Y (t)),
then
Pr{U(t + t) = (i 1, j + 1) | U(t) = (i, j)} = ijt + o(t),
Pr{U(t + t) = (i, j 1) | U(t) = (i, j)} = jt + o(t),
Pr{U(t + t) = (i, j) | U(t) = (i, j)} = 1 (i + )jt o(t).
There are multiple absorbing states for the general stochastic epidemic. The two possible
nal outcomes are:
1. All of the susceptibles in the total population become infected, hence the epidemic
ends with everybody as an infective or a removal. Thus, when X(t) = 0 and
Y (t) = N + I Z(t).
2. All of the infectives in the epidemic are removed from the population. Thus, when
Y (t) = 0 and X(t) = N + I Z(t).
5.3 Modelling the general stochastic epidemic
Example: Using R to calculate a general stochastic epidemic.
As with the simple stochastic epidemic, the general stochastic epidemic determines
the path of a random walk but takes randomness into account when doing so.
62
In order to compare the general stochastic epidemic to the general deterministic epi-
demic, this example will consider variables that are the same as an example used in the
general deterministic epidemic section of this report.
Considering a total population of N + I = 5000 individuals. The population starts
with X(0) = 4800 susceptibles and Y (0) = 200 infectives. Furthermore, the epidemic has
an infection parameter of = 0.0002 and a removal rate of = 0.5.
The example used in the general deterministic epidemic requires x(0) > . In this
example the initial number of infectives is 4800 and
=

=
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.

Example: Running multiple simulations.


Figure 23 is just one simulation run from the variables stated before. Running the
simulation multiple times shows how randomness is present in the stochastic general
deterministic epidemic model. As illustrated in Table 6 on the next page.
65
Simulation T
1
Z(T
1
)
1 28.63 4003
2 36.80 4006
3 28.14 4154
4 31.57 4006
5 29.45 4183
Table 6: Table comparing simulations that have the same variables from the example.
Table 6 shows that Figure 23 lasts signicantly longer than the other simulations run.
However, the number of removals in the population is always approximately equal to 4000.
Furthermore, the number of infectives is always zero at the end of the epidemic in each
simulation.

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

You might also like