-
next
Section 1: Overview and objectives
page 1 of 97
OVERVIEW
In MD06, we saw how assumptions about the amount of contact
between individualsinfluenced model predictions of the effect of
vaccination. This suggests that contactpatterns determine the herd
immunity threshold and therefore R0. In this session weillustrate
how we can calculate R0 to take account of different contact
patterns.
OBJECTIVES
By the end of this session you should:
Know the importance of accounting for non-random mixing between
individuals whencalculating the basic reproduction number and the
critical vaccination coveragerequired for controlling
transmission.Be able to calculate the basic reproduction number and
herd immunity threshold,assuming either that individuals mix
randomly or non-randomly.Know how reproduction number estimates are
currently used to estimate thepotential for a measles epidemic to
occur in England.
This session is made up of 2 parts and is likely to take 2-5
hours to complete.
The first part (1-2 hours) describes the theory for calculating
R0 and describes howcalculations of the reproduction number are
presently used in England to assess thepotential for a measles
epidemic to occur.
The second part (1-2 hours) consists of a practical exercise in
Excel, providing you withfurther practice in calculating the basic
and net reproduction numbers.
Home Contents Module Map Glossary Tools Help
EPM302 Modelling and the Dynamics of Infectious Diseases
MD07 Calculating R0 for non-randomlymixing populations
-
prev next
Section 2: Introduction
page 2 of 97
In the previous session , we explored the impact of different
levels of rubella vaccinationcoverage among newborns in a
population in which individuals were stratified into theyoung,
middle-aged and old (denoted by the symbols y, m and o) as shown in
the modeldiagram below.
Home Contents Module Map Glossary Tools Help
EPM302 Modelling and the Dynamics of Infectious Diseases
MD07 Calculating R0 for non-randomlymixing populations
-
prev next
2.1: Introduction
page 3 of 97
We assumed that the force of infection differed between the
young, middle-aged, and old,and was given by the following
equations:
Force_of_infn_y = b_yy*Infous_y + b_ym*Infous_m +
b_yo*Infous_o
Force_of_infn_m = b_my*Infous_y + b_mm*Infous_m +
b_mo*Infous_o
Force_of_infn_o = b_oy*Infous_y + b_om*Infous_m +
b_oo*Infous_o
Here, b_yy, b_ym etc represent the rate at which individuals in
a given age group comeinto effective contact with those in other
age groups per unit time.
Individuals in different age categories were assumed to contact
each other according toWho Acquires Infection From Whom (WAIFW)
matrices A and B (as shown below) wherethe parameters (in units of
per day) were calculated using the force of infection estimatedfrom
data on rubella seroprevalence for England and Wales:
WAIFW A y m o
y 1.81 10-5 0 0m 0 2.92 10-5 0o 0 0 3.35 10-5
WAIFW B y m o
y 1.66 10-5 4.16 10-6 4.16 10-6
m 4.16 10-6 4.16 10-6 4.16 10-6
o 4.16 10-6 4.16 10-6 4.16 10-6
Home Contents Module Map Glossary Tools Help
EPM302 Modelling and the Dynamics of Infectious Diseases
MD07 Calculating R0 for non-randomlymixing populations
-
Figure 1. Comparison between the WAIFW matrices A and B, which
were calculated using the force of infectionestimated from rubella
seroprevalence data from England and Wales in MD06 .
-
prev next
2.2: Introduction
page 4 of 97
For both assumptions about contact, predictions of the
age-specific proportion ofindividuals who were susceptible and the
daily number of new infections in the absence ofvaccination were
identical. However, predictions of these statistics differed
oncevaccination of newborns was introduced, as shown in Figure
2.
For example, if individuals were assumed to contact each other
according to matrixWAIFW A, then vaccination of newborns with a
coverage of 86% was insufficient to controltransmission. In
contrast, if individuals were assumed to contact each other
according tothe WAIFW B matrix, transmission stopped shortly after
the introduction of 86%vaccination coverage among newborns.
The differences between the predictions obtained using matrices
WAIFW A and WAIFW Breflect differences in R0 and therefore the herd
immunity threshold that is associated withthese two matrices. In
fact, as we shall see later, R0 for WAIFW A and WAIFW B is
about10.9 and 3.64 respectively, which correspond to values of the
herd immunity threshold of91% and 73% respectively.
In this session, we will show you how we can estimate R0 for
these and other assumptionsabout contact between individuals.
Figure 2. Comparisonbetween predictions of thedaily number of
new rubellainfections per 100,000population, obtainedassuming that
individualscontacted each otheraccording to WAIFWmatrices A and B,
using theBerkeley Madonna modelsfrom MD06 (see pages 54 and 58
respectively inMD06). Vaccination ofnewborns, with an
effectivecoverage of 86% isintroduced 100 years afterthe start.
Home Contents Module Map Glossary Tools Help
EPM302 Modelling and the Dynamics of Infectious Diseases
MD07 Calculating R0 for non-randomlymixing populations
-
prev next
Section 3: R0, Rn and the herd immunity threshold
page 5 of 97
Before illustrating how we can calculate R0 to take non-random
mixing between individualsinto account, we first review the methods
that are used to calculate R0 and how it is relatedto Rn and the
herd immunity threshold when we assume that individuals mix
randomly.
You may find that you can skip through the next few pages
quickly as you will have comeacross most of the content
previously.
Home Contents Module Map Glossary Tools Help
EPM302 Modelling and the Dynamics of Infectious Diseases
MD07 Calculating R0 for non-randomlymixing populations
-
prev next
3.1: The basic reproduction number (R0)
page 6 of 97
By now, you are probably familiar with the definition of the
basic reproduction number (R0)as the average number of secondary
infectious individuals generated by a single typicalinfectious
person following his/her introduction into a totally susceptible
population.
As we saw in MD03 , if we assume that individuals mix randomly,
R0 can be calculatedusing the following equation:
R0 = ND Equation 1
where
is the rate at which two specific individuals come into
effective contact per unittime;N is the population size;D is the
duration of infectiousness.
In a deterministic model, for the incidence to increase
following the introduction of aninfectious person into a totally
susceptible population, R0 must be bigger than one.
Home Contents Module Map Glossary Tools Help
EPM302 Modelling and the Dynamics of Infectious Diseases
MD07 Calculating R0 for non-randomlymixing populations
-
prev next
3.2: The net reproduction number (Rn)
page 7 of 97
If we assume that individuals mix randomly, R0 and the net
reproduction number, Rn, arerelated as follows:
Rn = R0s Equation 2
where s is the proportion of individuals who are susceptible in
the population.
This expression provides a useful method for calculating the
basic reproduction number.For example, when the infection is at
equilibrium, each infectious person will be leading toone secondary
infectious person. Thus the net reproduction number will then be
equal to1.
i.e.
Rn = 1
If we substitute for Rn = 1 into Equation 2 and then rearrange
it slightly, we obtain thefollowing equation:
R0 = 1/s* Equation 3
where s* is the proportion of the population that is susceptible
to infection at equilibrium.
This expression leads to several other expressions for the basic
reproduction number forrandomly-mixing populations, as we will show
on the next few pages.
Home Contents Module Map Glossary Tools Help
EPM302 Modelling and the Dynamics of Infectious Diseases
MD07 Calculating R0 for non-randomlymixing populations
-
prev next
a) Rectangular age distribution b) England and Wales: population
by age, 1991
Figure 3. a) Illustration of the relationship between the
proportion of the population that is susceptible and the
lifeexpectancy in a population with a rectangular age distribution.
The shaded area reflects the proportion of the population thatis
susceptible. Adapted from Fine PEM (1993)1 b) Population in England
and Wales, 1991. Data source: Office forNational Statistics.
3.3: Other expressions for R0, assuming that individuals
mixrandomly
page 8 of 97
As we saw in MD04 , the following expressions for R0 can be
obtained for populationswhose age distributions are approximately
rectangular or exponential, if we assume thatindividuals mix
randomly.
Rectangular age distributions: R0 L/AExponential age
distributions: R0 1+L/A
where A is the average age at infection and L is the average
life expectancy. Figure 3 andFigure 4 summarise the relationship
between A, L, and the proportion of the populationthat is
susceptible for populations with rectangular and exponential age
distributions.
Home Contents Module Map Glossary Tools Help
Figure 3 Figure 4
EPM302 Modelling and the Dynamics of Infectious Diseases
MD07 Calculating R0 for non-randomlymixing populations
-
prev next
3.4: Other expressions for R0 assuming that individuals
mixrandomly: N/(B(A-M))
page 9 of 97
When the average age at infection A is small, another equation
can be used regardless ofthe age distribution in the
population:
R0 N Equation 4B(A-M)
where
N is the population size;B is the number of surviving infants;M
is the duration of maternal immunity;andA is the average age at
infection (and issmall).
Figure 5. Illustration of the relationship between theproportion
of the population that is susceptible, the durationof
maternally-derived immunity and the average age atinfection for a
population with an unspecified demography.
Click here to see the derivation.
.
Home Contents Module Map Glossary Tools Help
EPM302 Modelling and the Dynamics of Infectious Diseases
MD07 Calculating R0 for non-randomlymixing populations
-
prev next
Show
3.5: Other expressions for R0 assuming that individuals
mixrandomly: 1/(1-i*)
page 10 of 97
Another equation can be applied when the infectiondoes not
confer immunity, i.e. when the appropriatemodel would be of the SIS
type, as seen in MD01 and illustrated in Figure 6.
In this instance R0 is given by the equation
R0=1/(1-i*) Equation 6
Figure 6. The general structure of a Susceptible Infectious
Susceptible (SIS) model
where i* is the equilibrium prevalence of infection (or
equivalently, of infectious individuals) in the population.
Click the show button below to see the derivation of this
equation.
IMPORTANT NOTE: These relatively simple equations assume that
individuals in thepopulation mix randomly. If we cannot assume that
individuals mix randomly, we need touse an alternative approach,
which we will discuss later.
Home Contents Module Map Glossary Tools Help
EPM302 Modelling and the Dynamics of Infectious Diseases
MD07 Calculating R0 for non-randomlymixing populations
-
prev next
Section 4: Herd immunity threshold
page 11 of 97
Whilst R0 is useful for indicating the transmissibility of an
infection, it can also be used todetermine the proportion of the
overall population at which an intervention, such asvaccination,
needs to be targeted in order to control transmission.
As you will have learned in your previous training, the herd
immunity threshold (H) is givenby the equation:
H=1-s* = 1-1/R0
For example, the basic reproduction number for measles in
several settings has beenestimated to be about 13 (click here to
see examples of estimated values for R0), whichsuggests that the
herd immunity threshold for measles is about:
100 x(1-
1 ) 92%13
This suggests that, in these settings, over 92% of the
population would need to beeffectively vaccinated in order to
control transmission.
Home Contents Module Map Glossary Tools Help
EPM302 Modelling and the Dynamics of Infectious Diseases
MD07 Calculating R0 for non-randomlymixing populations
-
prev next
Section 5: Summary of the steps in calculating R0 -
randomlymixing population
page 12 of 97
As we saw in MD04 , the following steps are required to
calculate R0 if we assume thatindividuals in a population mix
randomly and that the infection is at equilibrium:
1. Measure the prevalence of previous infection in the
population using aseroprevalence survey.
2. Assuming that the population is at equilibrium, calculate s*,
the proportion of thepopulation that is susceptible.
3. Calculate R0 using the expression R0= 1/s* (Equation 3 ).
Note that it is also possible to estimate R0 using the growth
rate of an epidemic oroutbreak (see MD03 ) or using data on the
secondary attack rate (see Fine, et al 2 ).
Home Contents Module Map Glossary Tools Help
EPM302 Modelling and the Dynamics of Infectious Diseases
MD07 Calculating R0 for non-randomlymixing populations
-
prev next
5.1: Summary of the steps in calculating R0 - assuming
non-random mixing
page 13 of 97
However, the situation is more complicated than that described
on the previous pages ifwe assume that individuals do not mix
randomly. We then need to follow the steps belowin order to
calculate R0:
1. Measure the prevalence of previous infection in the
population using a serosurvey.2. Estimate the forces of infection
in different subgroups (e.g. age strata).3. Choose the structure of
the matrix of Who Acquires Infection From Whom (WAIFW).4. Calculate
the parameters for the WAIFW matrix.5. Formulate the Next
Generation Matrix.6. Calculate R0 from the Next Generation
Matrix.
Steps 1 - 4 have been covered in sessions MD04 and MD06. In this
session we will dealwith steps 5 and 6.
Home Contents Module Map Glossary Tools Help
EPM302 Modelling and the Dynamics of Infectious Diseases
MD07 Calculating R0 for non-randomlymixing populations
-
prev next
5.2: Non-random mixing and the Next Generation Matrix
page 14 of 97
When we say that a population mixes nokn on-randomly, we imply
that the population canbe divided into two or more subgroups and
individuals in one subgroup have a differentamount of contact (e.g.
mix more or less intensively) with individuals from their
ownsubgroup than with individuals from another subgroup.
The number of secondary infectious individuals generated by one
infectious personintroduced into a totally susceptible population
then depends on the subgroup to whichthat person belongs.
Home Contents Module Map Glossary Tools Help
EPM302 Modelling and the Dynamics of Infectious Diseases
MD07 Calculating R0 for non-randomlymixing populations
-
prev next
5.3: Non-random mixing and the Next Generation Matrix
page 15 of 97
For example, in MD06 we considered the population in the diagram
below, in whichindividuals were stratified into the young and the
old (or children and adults). In thispopulation, each infectious
child generated a different number of secondary
infectiousindividuals from the number generated by an infectious
adult.
Also, the number of secondary infectious children generated by
each child differed from thenumber of infectious adults that they
generated.
As we shall show on the next few pages, we can summarise the
number of infectiouschildren and adults generated by each child and
adult using the Next Generation Matrix. We can then use the matrix
to calculate the basic reproduction number.
Population A Population B
A represents a child and a represents an adult.
Figure 7: Diagram showing the contact patterns of two
hypothetical populations considered in MD06 . Inpopulation A, an
infectious child could generate six secondary infectious
individuals, four of which would bechildren and two of which would
be adults. An infectious adult in the same population, on the other
hand, wouldgenerate three infectious individuals, two of whom would
be adults and one of whom would be a child.
Home Contents Module Map Glossary Tools Help
EPM302 Modelling and the Dynamics of Infectious Diseases
MD07 Calculating R0 for non-randomlymixing populations
-
prev next
5.4: Non-random mixing and the Next Generation Matrix
page 16 of 97
The Next Generation Matrix is defined as the matrix that
summarises the number ofsecondary infectious individuals in a given
category resulting from infectious individuals ineach of the
categories. For a population in which individuals are stratified
into either the"young" or the "old", it would be given by the
following matrix:
Here,
Ryy is the number of young secondary infectious individuals
generated by eachinfectious young person;Ryo is the number of young
secondary infectious individuals generated by eachinfectious old
person;Roy is the number of old secondary infectious individuals
generated by eachinfectious young person;Roo is the number of old
secondary infectious individuals generated by eachinfectious old
person.
Home Contents Module Map Glossary Tools Help
EPM302 Modelling and the Dynamics of Infectious Diseases
MD07 Calculating R0 for non-randomlymixing populations
-
prev next
5.5: Non-random mixing and the Next Generation Matrix
page 17 of 97
Notice the order of the subscripts used in the notation for the
numbers (or "elements") inthe Next Generation Matrix on the last
page. In each expression (e.g. Roy) the firstcomponent of the
subscript reflects the category of individuals among whom the
secondaryinfectious individuals occur (i.e. old individuals when
considering Roy), and the secondcomponent of the subscript reflects
the category of the infectious person who istransmitting the
infection (i.e. young individuals when considering Roy).
As shown on the next page, the order of the subscripts used for
Roy, Ryo, etc. is identical tothat used for the parameters.
Home Contents Module Map Glossary Tools Help
EPM302 Modelling and the Dynamics of Infectious Diseases
MD07 Calculating R0 for non-randomlymixing populations
-
prev next
Section 6: Summary of the notation used for the subscripts
page 18 of 97
The following summarises the notation used for the
parameters:
Therefore yo is the rate at which a specific young (susceptible)
individual comesinto effective contact with a specific old
(infectious) individual per unit time.
The following summarises the notation used for the Ryy, Ryo etc.
elements of the NextGeneration Matrix:
Therefore Ryo is the number of secondary infectious individuals
among youngindividuals resulting from one old (infectious)
individual in a totally susceptiblepopulation.
Home Contents Module Map Glossary Tools Help
EPM302 Modelling and the Dynamics of Infectious Diseases
MD07 Calculating R0 for non-randomlymixing populations
-
prev next
Population A1.Nextgenerationmatrix
child adult
child
adult
a) c) e) g)
b) d) f) h)
Section 7: Next Generation Matrix example - exercisepage 19 of
97
We will now practice using the Next Generation Matrix notation.
Below we show the two hypothetical mixing patterns that wediscussed
on page 15 in which individuals are either children or adults.
Population A Population B
Q1.1 The tabs below show examples of Next Generation Matrices.
Click on the appropriate Next Generation Matrix for
1) Population A2) Population B
from the options in the appropriate tab (tab 1 for population A,
tab 2 for population B). Not every option will be used, and
nooption will be used more than once.
Hint: The template for the Next Generation Matrix is shown at
the top of the tab. The titles above the columns of the matrix
referto the source of infection and the titles next to the rows of
the matrix refer to the recipient of the infection.
Home Contents Module Map Glossary Tools Help
1 2
EPM302 Modelling and the Dynamics of Infectious Diseases
0
Section 7: Next Generation Matrix example - exercise
file:///I:/DEP/SHARED/2013-14Final_ RESTRUCTURE/EPM302/EP...
1 of 1 04/04/2014 16:06
-
prev next
Section 8: Writing the Next Generation Matrix
page 20 of 97
Each of the numbers in the Next Generation Matrix can be
expressed in terms of thefollowing:
a) The parameters of the WAIFW matrix describing contact between
the young andold;b) The numbers of individuals in each age group;
andc) The duration of infectiousness.
We derive the expressions on the next few pages.
Home Contents Module Map Glossary Tools Help
EPM302 Modelling and the Dynamics of Infectious Diseases
MD07 Calculating R0 for non-randomlymixing populations
-
prev next
8.1: Writing the Next Generation Matrix
page 21 of 97
As discussed previously , if we assume that individuals mix
randomly, R0 is calculatedusing Equation 1:
R0 = ND Equation 1
where is the rate at which two specific individuals come into
effective contact per unittime, N is the total population size, and
D is the duration of infectiousness.
However, as we saw in MD06 , if we assume that individuals do
not mix randomly, needs to be stratified according to the subgroups
in the population. For example, the rateat which an infectious
child comes into effective contact with an adult may differ from
therate at which an infectious child comes into effective contact
with another child.
Home Contents Module Map Glossary Tools Help
EPM302 Modelling and the Dynamics of Infectious Diseases
MD07 Calculating R0 for non-randomlymixing populations
-
prev next
8.2: Writing the Next Generation Matrix
page 22 of 97
Extending the logic of Equation 1 , and considering a population
in which individuals arestratified into the young or old, we can
write down the number of young infectiousindividuals resulting from
the introduction of one infectious person into a totally
susceptiblepopulation as follows:
Ryy = yy Ny D Equation 7
where yy is the rate at which two specific young individuals
come into effective contact perunit time, Ny is the number of young
individuals in the population and D is the duration
ofinfectiousness.
Similarly, the number of infectious old individuals resulting
from the introduction of oneinfectious young person into a totally
susceptible population is given by:
Roy = oy No D Equation 8
where oy is the rate at which a specific young infectious person
comes into effectivecontact with a specific old susceptible
individual, and No is the total number of oldindividuals in the
population.
Home Contents Module Map Glossary Tools Help
EPM302 Modelling and the Dynamics of Infectious Diseases
MD07 Calculating R0 for non-randomlymixing populations
-
prev next
8.3: Writing the Next Generation Matrix
page 23 of 97
The expressions for the number of young secondary infectious
individuals resulting fromeach old infectious person and the number
of old secondary infectious individuals resultingfrom each old
infectious person (Ryo and Roo respectively) are analogous:
Ryo = yo Ny D Equation 9
and
Roo = oo No D Equation 10
Home Contents Module Map Glossary Tools Help
EPM302 Modelling and the Dynamics of Infectious Diseases
MD07 Calculating R0 for non-randomlymixing populations
-
prev next
8.4: Writing the Next Generation Matrix
page 24 of 97
As we saw on page 16 , the Next Generation Matrix is defined as
the matrix thatsummarises the number of secondary infectious
individuals in a given category resultingfrom infectious
individuals in each of the categories. We can now write down our
NextGeneration Matrix for our population comprising young and old
individuals as follows:
The following diagram summarises the notation used for the
subscripts:
Notice that the first subscript of Ryo (i.e. "y") reflects the
category of the recipient of theinfection and matches both the
first subscript of the parameter and that of the size of
thepopulation subgroup on the right-hand side of the equation.
The second subscript (i.e."o") reflects the category of the
source of infection and matchesthe second subscript of the
parameter on the right-hand side of this equation.
Home Contents Module Map Glossary Tools Help
EPM302 Modelling and the Dynamics of Infectious Diseases
MD07 Calculating R0 for non-randomlymixing populations
-
prev next
Answer
8.5: Writing the Next Generation Matrix: Exercise
page 25 of 97
During the last session we calculated the following WAIFW matrix
describing effectivecontact between the young and old in a region
in England with 500,000 individuals, usingdata on rubella, where
the parameters are in units of per day:
In this population, , and the
duration of infectiousness was 11 days.
Optional reading - explanation of the equations for Ny and
No
Q1.2 Write down the Next Generation Matrix corresponding to the
above WAIFW matrix.
Home Contents Module Map Glossary Tools Help
EPM302 Modelling and the Dynamics of Infectious Diseases
MD07 Calculating R0 for non-randomlymixing populations
-
prev next
8.6: Writing the Next Generation Matrix
page 26 of 97
In general terms, if we have a population in which individuals
are stratified into multiplegroups, the number of secondary
infectious individuals in group i produced by an infectiousperson
in group j in a totally susceptible population is denoted as Rij.
Extending the logicon page 24 , it can be calculated using the
following equation:
Rij= ij Ni D
where ij is the rate at which an infectious individual from
group j comes into effectivecontact with a specific susceptible
individual from group i per unit time, and Ni is the totalnumber of
individuals of group i.
The Next Generation Matrix simply contains all possible values
for Rij as its entries. In thismatrix Rij is the value in the i
th row and the jth column.
Home Contents Module Map Glossary Tools Help
EPM302 Modelling and the Dynamics of Infectious Diseases
MD07 Calculating R0 for non-randomlymixing populations
-
prev next
Answer
Answer
Section 9: Exercise: Writing down the Next Generation Matrixfor
a population comprising 3 groups
page 27 of 97
Q1.3 Suppose we have a population in which individuals are
stratified into the young,middle-aged and old (denoted by the
letters y, m, o) and that there are Ny, Nm, Noindividuals in these
groups.
a) Write down the equivalent of the matrix provided on page 16
for this population.
b) Write down the expressions for Ryy, Rym and Ryo, in terms of
Ny, yy, ym, yo andD.
Home Contents Module Map Glossary Tools Help
EPM302 Modelling and the Dynamics of Infectious Diseases
MD07 Calculating R0 for non-randomlymixing populations
-
prev next
Answer
Answer
9.1: Exercise: Writing down the Next Generation Matrix for
apopulation comprising 3 groups
page 28 of 97
Q1.3 ctd
c) Write down the expressions for Rmy, Rmm, and Rmo in terms of
Nm, my, mm, moand D.
d) Write down the expressions for Roy, Rom, and Roo in terms of
No, oy, om, oo andD.
Click here to see the Next Generation Matrix.
Home Contents Module Map Glossary Tools Help
EPM302 Modelling and the Dynamics of Infectious Diseases
MD07 Calculating R0 for non-randomlymixing populations
-
prev next
Section 10: Calculating R0
page 29 of 97
The number of secondary infectious individuals resulting from
the introduction of a "typical"infectious person into a totally
susceptible population will be some average of each of thenumbers
of the Next Generation Matrix.
As demonstrated by an example in section 7.5.2 of the
recommended course text5 ,taking the average of the number of
infectious individuals resulting from each young andold person does
not lead to the basic reproduction number. Instead, alternative
methodsneed to be used.
The theory to calculate the basic reproduction number was
developed by Heesterbeek etal during the 1990s (see Diekmann et al
(1990)3 ), and we will explore its applications inthe next pages.
Unfortunately the mathematical proof is beyond the scope of this
course.
Before presenting the method for calculating the basic
reproduction number, we first showhow R0 can be calculated from
some simple Next Generation Matrices.
Home Contents Module Map Glossary Tools Help
EPM302 Modelling and the Dynamics of Infectious Diseases
MD07 Calculating R0 for non-randomlymixing populations
-
prev next
Answer
Answer
10.1: Calculating R0 from the Next Generation Matrix
-exercise
page 30 of 97
EXAMPLE 1
Consider the following example of a Next Generation Matrix for a
given population in whichindividuals are either young or old,
denoted by the letters y and o respectively:
Q1.4a
i. How many infectious young individuals does each infectious
young person lead to?ii. How many infectious old individuals does
each infectious young person lead to?
Q1.4b
i. How many infectious young individuals does each infectious
old person lead to?ii. How many infectious old individuals does
each old infectious person lead to?
Q1.4c Given your answers to parts a and b, which of the values
listed below is the R0?
Hint: think about the total number of secondary infectious
individuals generated by either ayoung or old person.
R0 = 1 R0 = 2 R0 = 3 R0 = 6
Home Contents Module Map Glossary Tools Help
EPM302 Modelling and the Dynamics of Infectious Diseases
MD07 Calculating R0 for non-randomlymixing populations
-
prev next
Answer
10.2: Calculating R0 from the Next Generation Matrix
-Example
page 31 of 97
EXAMPLE 2
Consider the following Next Generation Matrix:
Q1.5a
i. How many secondary infectious individuals in total does each
young infectiousperson lead to?
ii. How many secondary infectious individuals in total does each
old infectious personlead to?
Q1.5b Which of the following is the basic reproduction number
for this Next GenerationMatrix?
R0 = 1 R0 = 2 R0 = 3 R0 = 4
Home Contents Module Map Glossary Tools Help
EPM302 Modelling and the Dynamics of Infectious Diseases
MD07 Calculating R0 for non-randomlymixing populations
-
prev next
10.3: Calculating R0 for more complicated Next
GenerationMatrices
page 32 of 97
Calculating R0 for the previous examples was relatively
straightforward because eachinfectious young and old person led to
the same total number of infectious individuals.However, in
practice, this is rarely the case.
Consider the following example:
The diagram on the right provides a visualrepresentation of this
Next Generation Matrix. Thishighlights the following:
One infectious child will lead to 1secondary infectious child
and 1 secondaryinfectious adult.
One infectious adult will lead to 1secondary infectious child
and 4 secondaryinfectious adults.
We will think about how we can calculate R0 on the next few
pages.
Home Contents Module Map Glossary Tools Help
EPM302 Modelling and the Dynamics of Infectious Diseases
MD07 Calculating R0 for non-randomlymixing populations
-
prev next
10.4: Calculating R0 for more complicated Next
GenerationMatrices
page 33 of 97
To calculate R0, we need to define a "typical" infectious
person, who is some suitableaverage of the subgroups.
For the matrices considered in the last few pages, this means
that the "typical" infectiousperson will be partly young and partly
old. In mathematical terms, if a fraction x of thistypical
infectious person is young, then by definition, a fraction (1-x)
must be old. We canrepresent this infectious individual using the
following vector notation:
See page 6 of the maths refresher to review the definition of
vectors and theirrelationship to matrices.You may prefer to do this
at a later stage, after you have had thechance to read through the
next few pages.
You will see how we can find the values for x and R0 on the next
page.
Home Contents Module Map Glossary Tools Help
EPM302 Modelling and the Dynamics of Infectious Diseases
MD07 Calculating R0 for non-randomlymixing populations
-
prev next
Section 11: Defining the typical infectious person and
findingR0
page 34 of 97
According to mathematical theory (the proof of which is beyond
the scope of this course,see Diekmann 19903 ), if we simulate the
introduction of an infectious person into a totallysusceptible
population in which there is an unlimited supply of susceptible
individuals andin which individuals contact each other according to
some Next Generation Matrix, thentwo things happen:
1. The number of secondary infectious individuals resulting from
each infectious personin each generation converges to R0; and
2. The distribution of the infectious individuals in each
generation converges to somedistribution, which reflects that of
the "typical" infectious person.
Therefore if we divide the number of infectious individuals in
one generation by that in theprevious generation, we will get R0.
Likewise, if we calculate the proportion of theindividuals in each
generation who belong to each of the subgroups, we can obtain
theproportion of the typical infectious person which belongs to
these subgroups and obtain x.
In this module, we shall refer to this method for calculating R0
as the simulationapproach. The application of this theory is fairly
straightforward, as we shall show on thenext few pages.
Home Contents Module Map Glossary Tools Help
EPM302 Modelling and the Dynamics of Infectious Diseases
MD07 Calculating R0 for non-randomlymixing populations
-
prev next
11.1: Defining the typical infectious person and finding R0
page 35 of 97
On the next few pages, we will show that the simulation process
described on the previouspage is equivalent to repeatedly
multiplying some vector representing an initial infectiousperson
introduced into a totally susceptible population by the Next
Generation Matrix.
We will illustrate how we can do this in Excel for the Next
Generation Matrix that weintroduced on page 32 :
Home Contents Module Map Glossary Tools Help
EPM302 Modelling and the Dynamics of Infectious Diseases
MD07 Calculating R0 for non-randomlymixing populations
-
prev next
11.2: Exercise - Finding R0 and x
page 36 of 97
1. Open the Excel file NGM_demo.xlsx .
You should see something resembling the the image below:
a) Pink and blue cells containing the Next Generation Matrix
(cells B4:C5). Thesecells have been assigned the names R_yy, R_yo,
R_oy and R_oo.b) Cells F4 and F5 contain the number of infectious
young and old individualsrespectively at the start.c) Cell F7
contains the total number of infectious individuals at the
start.
Home Contents Module Map Glossary Tools Help
EPM302 Modelling and the Dynamics of Infectious Diseases
MD07 Calculating R0 for non-randomlymixing populations
-
prev next
Answer a
Answer b
Answer c
11.3: Exercise - Finding R0 and x
page 37 of 97
Q1.6 Using pen and paper, calculate the following:
a) The number of secondary infectious young and old individuals
that you wouldexpect to see in the first generation.b) The total
number of infectious individuals that you would expect to see in
the firstgeneration.c) The ratio between the number of infectious
individuals in the first generation andthat at the start.
Click here if you would like to revise how matrices can be
multiplied to vectors.
2. If you wish, use pen and paper to calculate the numbers
mentioned in Q1.6 for thesecond generation. Alternatively, return
to the spreadsheet, select columns F andAA together, click with the
right mouse button and select the unhide option.Similarly, select
rows 8 and 10 together, click with the right mouse button and
selectthe unhide option.
You should now see how the number of infectious individuals
changes with eachgeneration. You should also see how the ratio
between the number of infectiousindividuals in a given generation
and that in the preceding generation converges to somevalue (4.3).
This value equals R0.
Home Contents Module Map Glossary Tools Help
EPM302 Modelling and the Dynamics of Infectious Diseases
MD07 Calculating R0 for non-randomlymixing populations
-
prev next
Answer
11.4: Exercise - Finding R0 and x
page 38 of 97
We will now explore how the proportion of infectious individuals
who are young and oldchanges in each generation.
3. Select rows 10 and 13 together, click with the right mouse
button and select the"Unhide" option.
4. You should now see cells showing the proportions of the
infectious individuals ineach generation who are young (pink) and
old (blue). You should notice that theseproportions converge to the
values 0.232408 (young) and 0.767592 (old). Thesevalues reflect the
proportions of the typical infectious person that is young and
old.
5. Change the number of infectious individuals introduced into
the population at thestart (in cells F4 and F5) to be the
following, and look at the value for R0 in eachcase.
a) 1 young person and 1 old person.b) 50 young people and 20 old
people.c) Any value for each category that you choose.
Q1.7 How does changing the number of infectious individuals
introduced at the startchange your estimate of R0 (see cell
Z9)?
Home Contents Module Map Glossary Tools Help
EPM302 Modelling and the Dynamics of Infectious Diseases
MD07 Calculating R0 for non-randomlymixing populations
-
prev next
Answer
11.5: Exercise - Finding R0 and x
page 39 of 97
We will now see whether this method for calculating R0 works for
another matrix.
6. Change the Next Generation Matrix in cells B4:C5 in the
spreadsheet to be asfollows and identify the value for R0.
Home Contents Module Map Glossary Tools Help
EPM302 Modelling and the Dynamics of Infectious Diseases
MD07 Calculating R0 for non-randomlymixing populations
-
prev next
11.6: Defining the typical infectious person and finding R0
page 40 of 97
As shown in the previous exercise, if we simulate the
introduction of an infectious personinto a totally susceptible
population in which different subgroups contact each otheraccording
to some Next Generation Matrix, then the ratio between the number
of infectiousindividuals in successive generations, and the
proportions of individuals in each generationthat belong to
different subgroups converge to some values. As shown by
Heesterbeek etal 3-4 , these numbers represent the values for R0
and the proportion of the typicalinfectious person that belongs to
each of the subgroups respectively.
For example, Figure 7 plotsthe estimates for the fractionof the
infectious person ineach generation that isyoung (=x) or old (=1-x)
ineach generation, which weobtain through thesimulation
processdescribed above if we usethe following Next
Generation Matrix: .
The graph shows that afterseveral (in this case 4)generations
the distributionof young and old infectiousindividuals in
eachgeneration converges to avalue that gives thedistribution of
the "typicalinfectious person".
For this Next GenerationMatrix, the typical infectiousperson is
23% young and77% old.
Figure 7. Proportion of individuals in each generation that are
young orold, obtained by simulating the introduction of infectious
individuals into atotally susceptible population, with unlimited
numbers of susceptibleindividuals, in which individuals contact
each other according to matrix
.
Home Contents Module Map Glossary Tools Help
EPM302 Modelling and the Dynamics of Infectious Diseases
MD07 Calculating R0 for non-randomlymixing populations
-
prev next
11.7: Defining the typical infectious person and finding R0
page 41 of 97
The same applies when we plot the ratio between the numbers of
infectious individuals ina given generation and that in the
previous generation.
We can see this in Figure 8, which shows that after several
generations have occurred,the ratio between the numbers of
infectious individuals in successive generationsconverges to some
value, which equals R0. In this case R0 4.3.
Figure 8. Ratio between the number of infectious individuals in
successive generations, obtained by simulatingthe introduction of
infectious individuals into a totally susceptible population, with
unlimited numbers of
susceptible individuals, in which individuals contact each other
according to matrix .
Home Contents Module Map Glossary Tools Help
EPM302 Modelling and the Dynamics of Infectious Diseases
MD07 Calculating R0 for non-randomlymixing populations
-
prev next
Section 12: Other methods for calculating R0
page 42 of 97
There are alternative ways to calculate R0. We discuss two of
them here.
Simultaneous equations approach
It can be shown that the simulation approach that we introduced
on page 34 forcalculating R0 and the proportion of the typical
infectious person that is young is equivalentto finding the values
for R0 and x which satisfy the following two equations
simultaneously:
Ryyx + Ryo (1-x) = R0x Equation 16
Roy x + Roo(1-x) = R0 (1-x) Equation 17
For the purposes of this study module, you do not need to be
able to derive theseequations. However, if you would like to find
out how we can obtain them, a simplifiedderivation of these
equations, based on the work of Diekmann et al 3-4 is provided in
theAppendix A.5.1 of the recommended course text5 .
Equation 16 and Equation 17 can also be written in matrix form
as follows:
Ryy Ryo x= Ro
xEquation 18Roy Roo
1 -x 1 - x
You can look at page 6 of the maths refresher or page 16 of MD06
if you would liketo revise how simultaneous equations can be
written using matrix notation.
On the next few pages, we will use the equations to find the R0
and x for the followingNext Generation Matrix that we saw on page
32 :
Home Contents Module Map Glossary Tools Help
EPM302 Modelling and the Dynamics of Infectious Diseases
MD07 Calculating R0 for non-randomlymixing populations
-
prev next
Explanation
12.1: Other methods for calculating R0: Illustration of
thesimultaneous equation approach
page 43 of 97
We begin by substituting the matrix into Equation 18 to obtain
the
following:
1 1
x = Ro
xEquation 191 4 1 - x 1 -x
After applying the rules for multiplying a matrix to a vector
(see page 6 of the mathsrefresher , we see that the left-hand side
of this equation simplifies to the following:
Using this simplification, we see that Equation 19 can be
written equivalently as
or, using simultaneous equations, as:
1 = R0x Equation 20
4 - 3x = R0 (1-x) Equation 21
After some rearranging (click on the button below for the
explanation), these equations canbe solved to give the following
two sets of possible values for x and R0, respectively.
R0 4.3 and x 0.23 orR0 0.69 and x 1.23
Since it is not possible for the fraction of the typical
infectious person that is young to bebigger than 1, we are led to
accept the value for R0 and x of 4.3 and 0.23, respectively.
These values are consistent with those estimated using the
simulation approach seenpreviously (see pages 40 and 41 ).
Home Contents Module Map Glossary Tools Help
EPM302 Modelling and the Dynamics of Infectious Diseases
MD07 Calculating R0 for non-randomlymixing populations
-
prev next
12.2: Optional - other methods for calculating R0
page 44 of 97
As illustrated by the example on page 43, there may be more than
one value for "R0"which satisfies Equation 18 . According to
mathematical theory (which is beyond thescope of this course), R0
is then taken to be the largest value which satisfies that
equation.
A hand-waving explanation for why R0 is taken as the largest
value which satisfiesEquation 18 is that, if we substitute it into
the equation for the herd immunity threshold (1-1/R0), it leads to
the higher value for the proportion of the population which needs
to beimmune to control transmission. If coverage of the
intervention were to be introduced atthis level in the overall
population, it is likely to be sufficiently high to control
transmissioneven in the highest risk group.
The mathematical name for the largest value satisfying Equation
18 is the "dominanteigenvalue of the Next Generation Matrix".
If you are interested in reading more about this, see Diekmann
and Heesterbeck3 , andthe recommended course text5 , pages 212-215
for further details.
We will now consider another approach for calculating R0. We
will refer to this method asthe Matrix determinant approach
Home Contents Module Map Glossary Tools Help
EPM302 Modelling and the Dynamics of Infectious Diseases
MD07 Calculating R0 for non-randomlymixing populations
-
prev next
12.3: Optional - other methods for calculating R0
page 45 of 97
Matrix determinant approach
If we have a population comprising 2 subgroups (denoted using
the subscripts y and orespectively), then it can be shown that
finding the value for R0 which satisfies Equation18 is equivalent
to finding the value of which satisfies the following equation:
(Ryy - )(Roo - ) - RyoRoy = 0 Equation 24
As R0 is given by the largest value which satisfies Equation 18,
R0 must also be the largestvalue of which satisfies Equation
24.
For the purposes of this study module, you are not expected to
be able to derive Equation24. However, if you are interested,
further details of how Equation 24 can be derived fromEquation 18
and why this approach can be referred to as the "matrix
determinantapproach" are provided in the recommended course text5
on pages 212-215 andAppendix A.5.1.2.
We will illustrate how we can apply Equation 24 on the next
page.
Home Contents Module Map Glossary Tools Help
EPM302 Modelling and the Dynamics of Infectious Diseases
MD07 Calculating R0 for non-randomlymixing populations
-
prev next
12.4: Optional - other methods for calculating R0
page 46 of 97
We return to the matrix that we considered on page 32 , namely
.
In this matrix Ryy = 1, Ryo = 1, Roy = 1 and Roo = 4.
Substituting for these values into Equation 24 , we obtain the
following equation:
(1 - )(4 - ) - 1*1 = 0
This equation can be rearranged to give the following:
2 - 5 + 3 = 0
This equation is analogous to Equation 22 which is discussed in
the derivation of the valuefor R0 using the simultaneous equations
approach (click on the "Explanation button" onpage 43 ). The
remainder of the derivation presented on that page, together with
the factthat R0 is the largest value of which satisfies Equation 24
leads to the result that R0 4.3.
Home Contents Module Map Glossary Tools Help
EPM302 Modelling and the Dynamics of Infectious Diseases
MD07 Calculating R0 for non-randomlymixing populations
-
prev next
Section 13: Calculating the net reproduction number
page 47 of 97
The methods that we have described so far in this session to
calculate Ro can be appliedto calculate the net reproduction number
(Rn) for a non-randomly mixing population, inwhich some individuals
may already be immune, as a result of vaccination or
previousinfection. In this instance, the Next Generation Matrix is
written down using the number ofsusceptible (rather than all)
individuals in each group. For example, considering apopulation in
which individuals are stratified into the young and old, Ryy, Ryo,
Roy, and Roowould be given by the following equations (see also the
diagram below):
Ryy = yySyD
Ryo = yoSyD
Roy = oySoD
Roo = ooSoD
where Sy and So are thenumber of susceptible youngand old
individuals.
Rn is then calculated usingthe resulting NextGeneration Matrix
in thesame way we calculated R0above. We will illustrate thisin
further detail in thepractical part of this session.
Home Contents Module Map Glossary Tools Help
EPM302 Modelling and the Dynamics of Infectious Diseases
MD07 Calculating R0 for non-randomlymixing populations
-
prev next
13.1: Extending the method to deal with more than
twosubgroups
page 48 of 97
The methods that we have described to calculate R0 can also be
extended relatively easilyto deal with populations consisting of
more than two subgroups.
For example, if the population comprised 3 subgroups, a fraction
x, w and 1-x-w of thetypical infectious person would belong to the
first, second and third subgroups. For a NextGeneration Matrix such
as the following, in which the population is stratified into the
young,middle-aged and the old (denoted by the letters y, m and o
respectively):
we could calculate R0 by simulating the introduction of an
infectious person into a totallysusceptible population in which
there is an unlimited supply of susceptible individuals andin which
individuals contact each other according to this Next Generation
Matrix.
Home Contents Module Map Glossary Tools Help
EPM302 Modelling and the Dynamics of Infectious Diseases
MD07 Calculating R0 for non-randomlymixing populations
-
prev next
13.2: Extending the method to deal with more than
twosubgroups
page 49 of 97
As in the case when the population is stratified into two age
groups , R0 then equals theratio between the number of infectious
Individuals in a given generation and that in theprevious
generation after the ratio had converged. x, w and (1-x-w) can then
be calculatedas the proportion of each generation which are in the
first, second and third subgroupsrespectively.
Adapting the simultaneous equations approach described for two
age groups to dealwith three age groups, we see that R0 can also be
calculated by solving the followingmatrix equation:
or, for the matrix described on the previous page, as
follows:
This equation could be written equivalently using the following
simultaneous equations:
x+5w+4(1-x-w) = R0x
2x+3w+6(1-x-w) = R0w
3x+7w+8(1-x-w) = R0(1-x-w)
Home Contents Module Map Glossary Tools Help
EPM302 Modelling and the Dynamics of Infectious Diseases
MD07 Calculating R0 for non-randomlymixing populations
-
prev next
Section 14: Practical application of the Next GenerationMatrix
to calculate Rn for measles in England and Wales
page 50 of 97
The methods described above have been and are still used to
estimate the netreproduction number for various diseases. In
particular, during the mid-1990s thesetechniques were used by the
then Public Health Laboratory Service to assess the potentialfor a
measles epidemic to occur in England and the need for further
measles vaccination.The work was carried out by Gay and colleagues,
and has since been published6-7 .
We discuss this application on the next few pages.
Home Contents Module Map Glossary Tools Help
EPM302 Modelling and the Dynamics of Infectious Diseases
MD07 Calculating R0 for non-randomlymixing populations
-
prev next
14.1: Practical applications: calculating Rn for measles
inEngland and Wales - background
page 51 of 97
Measles vaccine was introduced in England in 1968, but its
uptake was variable (seeFigure 9, dotted line). The introduction of
vaccination resulted in a decline in the notificationrates for
measles (see Figure 9, bars), and by the early 1990s they had
reached a verylow level.
During the first half of 1994, slight increases were seen in the
notification rates (see Figure9, red circle); a large outbreak had
occurred in Scotland during the period 1993-4 andthere were
concerns that a large epidemic, with more than 100,000 cases, was
imminent.
Work was carried out by Gay et al to estimate the net (or
effective) reproduction number(Rn) in England and Wales and whether
it was likely that an epidemic would occur
6 .
Figure 9. Measles notifications and deaths in England and Wales.
Extracted from Gay et al6 , .
Home Contents Module Map Glossary Tools Help
EPM302 Modelling and the Dynamics of Infectious Diseases
MD07 Calculating R0 for non-randomlymixing populations
-
prev next
14.2: Practical applications: calculating Rn for measles
inEngland and Wales the model
page 52 of 97
Figure 10 shows examples of the WAIFW matrices calculated using
values for the force ofmeasles infection estimated from data from
England and Wales from before theintroduction of measles
vaccination6 . The force of infection among those aged over 10years
was not reliably known, due to the high prevalence of immunity in
this agegroup. This meant that the parameters for a given structure
for the WAIFW matrix couldnot be reliably estimated. For a given
WAIFW structure, Gay et al therefore used severaldifferent
assumptions about the amount of contact between individuals in this
age groupand those in other age groups.
Figure 10. Examples of WAIFW matrices describing contact between
different age groups in England and Walesobtained by Gay et al,
using estimates of the force of infection for measles, calculated
using data collectedbefore the introduction of vaccination6 .
reflects the factor by which the rate at which 10-14 year olds
comeinto contact with each other differs from that between
individuals aged 5-9 years. Extracted from Gay et al6 .
Home Contents Module Map Glossary Tools Help
EPM302 Modelling and the Dynamics of Infectious Diseases
MD07 Calculating R0 for non-randomlymixing populations
-
prev next
14.3: Practical applications: calculating Rn for measles
inEngland and Wales the model
page 53 of 97
Gay et al then combined these estimates with estimates of the
proportion of individuals indifferent age groups who were
susceptible to measles infection (see Figure 11) in 1994.
Figure 11. Estimates of the percentage of different birth
cohorts alive in England and Wales who weresusceptible to measles
in 19946 , calculated using haemagglutination inhibition (HI) data
for those born before1984 and different assumptions about the
proportion susceptible for those born after 1985/6 (labelled
ScenarioA" and "Scenario B). See Gay et al6 for further details of
these assumptions.
Home Contents Module Map Glossary Tools Help
EPM302 Modelling and the Dynamics of Infectious Diseases
MD07 Calculating R0 for non-randomlymixing populations
-
prev next
14.4: Practical applications: estimates of Rn for measles
inEngland and Wales
page 54 of 97
The figure below shows the estimates for the net reproduction
number (Rn) obtained byGay et al using different assumptions about
contact between 10-14 year olds. Theseresults highlighted that the
net reproduction number in 1994 in England and Wales wasvery close
to 1 (the horizontal dashed line) and that there was potential for
an epidemic tooccur.
Further calculations carried out by Gay et al suggested that if
an outbreak occurred, itcould involve more than 100,000 cases.
These conclusions were supported by otherstudies using dynamic
models 6 .
As a result of these analyses, a measles-rubella vaccination
campaign was carried out inNovember 1994 in England and Wales,
targeting 95% of the 7 million 5-16 yr olds. Nomeasles epidemic was
recorded during the subsequent few years.
This was perhaps the first time that modelling was used to guide
vaccination policy in theUK. Since then, the potential for a
measles epidemic to occur in England and Walescontinues to be
evaluated in the same way7 .
If you have time, try Exercise 7.4 and the exercises associated
with model 7.5 of the onlineexercises associated with the course
text5 , where you can try doing these calculationsyourself.
Figure 12. Estimates for Rn during the 1990s in England and
Wales obtained using different assumptions about
Home Contents Module Map Glossary Tools Help
EPM302 Modelling and the Dynamics of Infectious Diseases
MD07 Calculating R0 for non-randomlymixing populations
-
contact between individuals aged 10-14 years. See page 52 and
Gay et al6 for further details.
-
prev next
Section 15: Break
page 55 of 97
We have now completed part 1 of this session, in which we
covered the theory for how wecan calculate R0 to account for
non-random mixing between individuals.
The rest of this session consists of a practical exercise,
during which you will be able toapply the theory, using Excel and
Berkeley Madonna. This exercise is likely to take 1-3hours . You
may like to take a break before continuing.
Home Contents Module Map Glossary Tools Help
EPM302 Modelling and the Dynamics of Infectious Diseases
MD07 Calculating R0 for non-randomlymixing populations
-
prev next
Section 16: Practical: calculating the basic reproductionnumber
for a non-randomly mixing population
page 56 of 97
OVERVIEW
We will now start parts 2 and 3 of this session during which you
will apply the theorydiscussed in the first part to calculate the
Next Generation Matrix and R0 for a given set ofassumptions about
contact between individuals.
OBJECTIVES
By the end of the practical part of this session you should:
Be able to write down the "Next Generation Matrix" for given
assumptions aboutcontact between individuals.Understand the
relationship between the basic reproduction number and the
NextGeneration Matrix.Be able to calculate R0 by using the
simulation approach, i.e. simulating transmissionfollowing the
introduction of one infectious person into a totally
susceptiblepopulation mixing according to given contact patterns.Be
able to calculate the net reproduction number from the Next
Generation Matrix.Be able to calculate R0 using the simultaneous
equations approach in Excel.
Part 2 of this session provides further practice in writing down
the Next Generation Matrixand using it to calculate R0. Part 3 of
this session illustrates how R0 can be calculatedusing the
simultaneous equations and matrix determinant approaches.
Home Contents Module Map Glossary Tools Help
EPM302 Modelling and the Dynamics of Infectious Diseases
MD07 Calculating R0 for non-randomlymixing populations
-
prev next
16.1: Part 2 (Practical): Introduction
page 57 of 97
In this exercise, we will revisit the population that we worked
with in the practicalcomponent of MD06 , in which individuals were
stratified into the young, middle-agedand old, and illustrate how
we can calculate R0 associated with matrices WAIFW A andWAIFW
B.
Click here to remind yourselves of these matrices.
Home Contents Module Map Glossary Tools Help
EPM302 Modelling and the Dynamics of Infectious Diseases
MD07 Calculating R0 for non-randomlymixing populations
-
prev next
16.2: Part 2 (Practical): Calculating the Next
GenerationMatrix
page 58 of 97
We first focus on how we can calculate the Next Generation
Matrix associated withWAIFW B.
Calculating the Next Generation Matrix for populations mixing
accordingto WAIFW B
1. Open up the Excel file R0waifb.xls . The layout of the
spreadsheet shouldresemble what you see in the image below:
The blue cells (rows 2-20) contain the parameters required to
calculate the basicreproduction number, namely:
a) The average duration of infectiousness (ave_infous).
Home Contents Module Map Glossary Tools Help
EPM302 Modelling and the Dynamics of Infectious Diseases
MD07 Calculating R0 for non-randomlymixing populations
-
b) The total number of individuals in the young, middle-aged and
old categories(N_y, N_m and N_o respectively).c) The proportion
immune (prop_imm, currently set to be 0).d) The number of young,
middle-aged and old susceptible individuals (S_y, S_mand S_o
respectively).e) The daily rate at which specific infectious and
susceptible individuals in differentage categories come into
effective contact, namely
b_yy, b_ym, b_yo, b_my, b_mm, b_mo, b_oy, b_om, b_oo,
located in cells F17:H19.
NOTE: You can see the name of a given cell by clicking on that
cell and looking in thebox in the top left hand corner of your
sheet, just below the menu bar.
The orange cells in cells F25:H27 will contain the entries for
the Next Generation Matrix,and have been assigned the names R_yy,
R_ym, R_yo, R_my, R_mm, R_mo, R_oy,R_om and R_oo.
We will set up expressions in these cells later. Please do not
do so just yet!
-
prev next
Answer
16.3: Part 2 (Practical): Calculating the Next
GenerationMatrix
page 59 of 97
Q2.1 Looking at the orange cells in the spreadsheet (cells
F25:H27), how many secondaryinfectious individuals among young
individuals will occur as a result of the introduction of:
i) 1 infectious young personii) 1 infectious middle-aged person
andiii) 1 infectious old person?
You may have noticed that the equations in cells F25, G25 and
H25 have been set upusing the number of susceptible young,
middle-aged and old individuals, rather than interms of the total
number of individuals in each category. We could have set up
theseequations to be in terms of the total numbers of individuals
in each category, i.e. N_y, N_mand N_o. However, later in this
practical, we will vary the proportion of the population thatis
immune in the population and use these cells to calculate the net
reproduction number.For this reason, the numbers in these cells
have been expressed in terms of the number ofsusceptible
individuals in each category.
Home Contents Module Map Glossary Tools Help
EPM302 Modelling and the Dynamics of Infectious Diseases
MD07 Calculating R0 for non-randomlymixing populations
-
prev next
Hint Answer
16.4: Part 2 (Practical): Calculating the Next
GenerationMatrix
page 60 of 97
2. Using pen and paper, write down the appropriate expressions
for the number ofsecondary infectious individuals which would occur
among middle-aged susceptibleindividuals as a result of the
introduction of:
i) 1 young infectious person,ii) 1 middle-aged infectious
person, andiii) 1 old infectious person.
3. Now set up the appropriate expressions in cells F26, G26 and
H26 of thespreadsheet.
Home Contents Module Map Glossary Tools Help
EPM302 Modelling and the Dynamics of Infectious Diseases
MD07 Calculating R0 for non-randomlymixing populations
-
prev next
Answer
16.5: Part 2 (Practical): Calculating the Next
GenerationMatrix
page 61 of 97
4. Select the appropriate terms (from the drop-down menus below)
to complete theequations for the number of secondary infectious
individuals which would occuramong old susceptible individuals as a
result of the introduction of:
i) 1 young infectious person = * *
ii) 1 middle-aged infectious person=
* *
iii) 1 old infectious person = * *
5. Now set up the appropriate equations in cells F27, G27 and
H27 of the spreadsheet.
Home Contents Module Map Glossary Tools Help
EPM302 Modelling and the Dynamics of Infectious Diseases
MD07 Calculating R0 for non-randomlymixing populations
-
prev next
Answer
16.6: Part 2 (Practical): Calculating the Next
GenerationMatrix
page 62 of 97
Q2.2 How many secondary infectious individuals does each young,
middle-aged and oldinfectious person generate in a totally
susceptible population? Select the correct option foreach age group
from the drop down menus.
a) Each young infectious person generates infectious individuals
in atotally susceptible population.
b) Each middle-aged infectious person generates
infectiousindividuals in a totally susceptible population.
c) Each old infectious person generates infectious individuals
in atotally susceptible population.
If you find that your answers differ from those provided, click
here to open upR0waifwb_solna.xlsx, where you can check your
expressions.
Home Contents Module Map Glossary Tools Help
EPM302 Modelling and the Dynamics of Infectious Diseases
MD07 Calculating R0 for non-randomlymixing populations
-
prev next
Section 17: Part 2 (Practical): Calculating R0 using
thesimulation approach
page 63 of 97
Our Next Generation Matrix is now as follows:
We will now calculate the basic reproduction number
corresponding to this NextGeneration Matrix using the simulation
approach that we introduced on page 34 .
Home Contents Module Map Glossary Tools Help
EPM302 Modelling and the Dynamics of Infectious Diseases
MD07 Calculating R0 for non-randomlymixing populations
-
prev next
Answer
17.1: Part 2 (Practical): Calculating R0 using the
simulationapproach
page 64 of 97
6. Select rows 43 and 58 together, click with the right mouse
button and choose the"Unhide" option.
You should now see some pink cells containing statistics
relating to the number ofinfectious individuals which result over
time as a result of the introduction of one infectiousperson into a
totally susceptible population. At present, this person has been
specified tobe young.
Q2.3 According to cell B48, how many young infectious
individuals will occur in the firstgeneration as a result of the
introduction of this infectious individual?
Home Contents Module Map Glossary Tools Help
EPM302 Modelling and the Dynamics of Infectious Diseases
MD07 Calculating R0 for non-randomlymixing populations
-
prev next
Hint Answer
17.2: Part 2 (Practical): Calculating R0 using the
simulationapproach
page 65 of 97
7. Set up an appropriate expression for the number of
middle-aged infectiousindividuals (in cell C48), which will occur
in the first generation as a result of theintroduction of the
initial infectious person.
Home Contents Module Map Glossary Tools Help
EPM302 Modelling and the Dynamics of Infectious Diseases
MD07 Calculating R0 for non-randomlymixing populations
-
prev next
Answer
17.3: Part 2 (Practical): Calculating R0 using the
simulationapproach
page 66 of 97
8. Similarly, set up appropriate expressions for:
i) the number of old infectious individuals (in cell D48),
andii) the total number of infectious individuals (in cell E48)
which will occur in the first generation as a result of the
introduction of the initialinfectious person.
If your answer differs from the one provided above, refer to
R0waifb_solnb.xlsx whichholds the expressions that you should have
set up by now.
NOTE: There is an alternative method for setting up these
equations in Excel, which isexplained on the next page.
Home Contents Module Map Glossary Tools Help
EPM302 Modelling and the Dynamics of Infectious Diseases
MD07 Calculating R0 for non-randomlymixing populations
-
prev next
Section 18: Part 2 (Practical): Calculating R0 using
thesimulation approach
page 67 of 97
Alternative expressions for the number of infectious individuals
in agiven age category
As an alternative, you could have also typed the following into
the cell for the number ofyoung infectious individuals in the first
generation:
=SUMPRODUCT($F$25:$H$25,B47:D47)
This calculates the sum of the cross-product of the cells in the
range F25:H25 andB47:D47 i.e.
F25*B47 + G25*C47 + H25* D47
The dollar signs have been inserted for the cell range F25:H25
so that, when this formulais copied down to the next row, it still
refers to the same cells F25:H25.
The corresponding formulae for the number of middle-aged and old
infectious individualsin the first generation would be:
=SUMPRODUCT($F$26:$H$26,B47:D47) (middle-aged
infectiousindividuals)=SUMPRODUCT($F$27:$H$27,B47:D47) (old
infectious individuals)
Home Contents Module Map Glossary Tools Help
EPM302 Modelling and the Dynamics of Infectious Diseases
MD07 Calculating R0 for non-randomlymixing populations
-
prev next
Show
Answer
Answer
18.1: Practical: Part 2 (Practical): Calculating R0 using
thesimulation approach
page 68 of 97
Q2.4 According to cells G48-I48, what proportion of infectious
individuals in the firstgeneration are young, middle-aged and
old?
Click the button below to see what you should see at this
point.
Q2.5 According to cell K48, how many secondary infectious
individuals resulted directlyfrom the initial infectious person
introduced into the population?
Home Contents Module Map Glossary Tools Help
EPM302 Modelling and the Dynamics of Infectious Diseases
MD07 Calculating R0 for non-randomlymixing populations
-
prev next
18.2: Practical: Part 2 (Practical): Calculating R0 using
thesimulation approach
page 69 of 97
We will now explorewhat happens in thesecond
andsubsequentgenerations.
9. Copy all theexpressions forthe firstgenerationdown until
the10thgeneration.
10. Now selectcolumns N andY together,click with theright
mousebutton andselect theunhide option.
You shouldnow see twofiguresresemblingthose shownon the
right.
The top graphshows the agedistribution of theinfectious
individualsin each generation.
Home Contents Module Map Glossary Tools Help
EPM302 Modelling and the Dynamics of Infectious Diseases
MD07 Calculating R0 for non-randomlymixing populations
-
The bottom graphshows the averagenumber of secondaryinfectious
individualsresulting from eachinfectious person.
If the graphs that yousee at this stagediffer from thoseshown
here, clickhere to open upR0waifwb_solnc.xlsx,where you can
checkyour expressions.
-
prev next
Answer
Answer
18.3: Practical: Part 2 (Practical): Calculating R0 using
thesimulation approach
page 70 of 97
Q2.6 What happens to the age distribution of the new infectious
individuals in eachgeneration after a few generations have
occurred?
Q2.7 What is the average number of secondary infectious
individuals resulting from eachinfectious person after a few
generations have occurred?
Home Contents Module Map Glossary Tools Help
EPM302 Modelling and the Dynamics of Infectious Diseases
MD07 Calculating R0 for non-randomlymixing populations
-
prev next
Answer
Section 19: Part 2 (Practical): Effective vaccination
coveragerequired to control transmission
page 71 of 97
11. Calculate the level of effective vaccination coverage that
would be required to controltransmission in a population which
mixed according to WAIFW B, assuming that thebasic reproduction
number was equal to the value obtained in the previous
question.
Home Contents Module Map Glossary Tools Help
EPM302 Modelling and the Dynamics of Infectious Diseases
MD07 Calculating R0 for non-randomlymixing populations
-
prev next
19.1: Part 2 (Practical): Testing the estimated value for
R0using the Berkeley Madonna model
page 72 of 97
We will now return to the model that we worked with in MD06,
which described thetransmission of rubella in a population in which
individuals were stratified into the young,middle-aged and old. We
will test to see if the value for R0 that we estimated for WAIFW
Bis correct by exploring what happens when we incorporate
vaccination at levels ofcoverage which are similar to those
calculated in the previous step.
12. Start up Berkeley Madonna and open the Berkeley Madonna file
waifwb_ R0 -flowchart.mmd or waifwb_R0 - equations.mmd . The model
in this file isidentical to the one which you used in in MD06,
except for the fact all the parameters for WAIFW B have already
been set up. Click here if you would like toremind yourself of the
key features of this model. Run the model and click on Page 3of the
Figures window to see the daily number of new infections per
100,000population for the three age groups.
Vaccination of newborns is currently introduced on day 36500 (or
year 100) in the model.
Home Contents Module Map Glossary Tools Help
EPM302 Modelling and the Dynamics of Infectious Diseases
MD07 Calculating R0 for non-randomlymixing populations
-
prev next
Answer
19.2: Part 2 (Practical): Testing the estimated value for
R0using the Berkeley Madonna model
page 73 of 97
Q2.8 How do you think predictions of the daily number of new
infections per 100,000among young, middle-aged and old individuals
will change if you introduce vaccination ofnewborns at the
following levels of effective coverage:
i) 72%ii) 72.2%iii) 72.3%iv) 72.4%v) 72.5%
13. Check your hypothesis by running the model for the levels of
effective coveragespecified in the previous question. Remember that
you can modify the vaccinecoverage by moving the slider to the
desired level, or by typing in the value in theparameters
window.
You can check that you are getting the correct figures by
clicking on the tab which islabelled with the vaccination coverage
that you are interested in. If your model has crashedor you are not
getting these results, open up the file waifwb_ R0 - flowchart.mmd
orwaifwb_R0 - equations.mmd again and ensure that you are entering
the vaccinationcoverage as a proportion and not as a
percentage.
Home Contents Module Map Glossary Tools Help
72% vaccination coverage
72.2% vaccination coverage
72.3% vaccinationcoverage
72.4% vaccination coverage
72.5% vaccination coverage
EPM302 Modelling and the Dynamics of Infectious Diseases
MD07 Calculating R0 for non-randomlymixing populations
-
According to these graphs, transmission appears to stop if the
level of effective vaccinationcoverage is 72.3%, which is below the
herd immunity threshold that we calculated in step11 . However,
this conclusion is incorrect. If we click on the table button , we
see thata tiny number of new infections are still occurring even on
day 300,000.
As we shall show on the next page, we can see this in detail if
we change the figure sothat the number of new infections per
100,000 is plotted on a log scale.
-
prev next
Show
19.3: Part 2 (Practical): Testing the estimated value for
R0using the Berkeley Madonna model
page 74 of 97
14. Copy the figure on Page 3 to a new figure by clicking on the
button and changethe scale on the y-axis to go from a minimum of
10-40 to a maximum of 20, and to belogarithmic. See page 5 of the
guide to Berkeley Madonna if you would like toremind yourself of
how to change the scale of the y-axis.
Click the button below to see the figure that you should see by
this stage for levels ofeffective coverage of 72.3%, 72.4% and
72.5%.
If your output fails to match these figures, check your settings
against those in the fileWAIFWB_R0 - flowchart_solna.mmd or
WAIFWB_R0 - equations_solna.mmd .
Home Contents Module Map Glossary Tools Help
EPM302 Modelling and the Dynamics of Infectious Diseases
MD07 Calculating R0 for non-randomlymixing populations
-
prev next
Answer
19.4: Part 2 (Practical): Testing the estimated value for
R0using the Berkeley Madonna model
page 75 of 97
Q2.9 What can we conclude about the herd immunity threshold from
our BerkeleyMadonna model?
Home Contents Module Map Glossary Tools Help
EPM302 Modelling and the Dynamics of Infectious Diseases
MD07 Calculating R0 for non-randomlymixing populations
-
prev next
Answer
Section 20: Part 2 (Practical): Effect of the initial numbers
ofinfectious individuals on estimates of R0
page 76 of 97
15. Return to the spreadsheet that you were working with. If you
have already closed thespreadsheet, click here to open up the
spreadsheet that you should havedeveloped by now. Change the
numbers of infectious individuals introduced into thepopulation at
the start to take the following values and look at the figures
showingthe age distribution of infectious individuals in each
generation, and the ratiobetween the numbers of infectious
individuals in successive generations:
i) 20, 50, 30 young, middle-aged and old infectious individuals
respectively.
ii) 30, 20 and 2 young middle-aged and old infectious
individuals respectively.
iii) 0.5, 0.2 and 0.3 young, middle-aged and old infectious
individualsrespectively.
Q2.10 How does changing the values for the numbers of infectious
individuals introducedinto the population at the start affect the
age distribution of infectious individuals and theratio between the
number of infectious individuals in successive generations, after a
fewgenerations have occurred?
Home Contents Module Map Glossary Tools Help
EPM302 Modelling and the Dynamics of Infectious Diseases
MD07 Calculating R0 for non-randomlymixing populations
-
prev next
Expected results
20.1: Part 2 (Practical): Net reproduction number
page 77 of 97
The methods applied in this session can also be used to
calculate the net reproductionnumber if, for example, a proportion
of the population is immunised.
16. Still working with your spreadsheet, change the value for
prop_imm (cell F8) to thevalues listed below to see what happens to
the average number of secondaryinfectious individuals resulting
from each infectious person after a few generationshave occurred if
the following proportions of the population are immune:
i) 25%ii) 50%iii) 72.5%iv) 75%
Before continuing, you may like to save your Excel file.
Home Contents Module Map Glossary Tools Help
EPM302 Modelling and the Dynamics of Infectious Diseases
MD07 Calculating R0 for non-randomlymixing populations
-
prev next
Section 21: Part 2 (Practical): Additional exercises
page 78 of 97
We have now completed part 2 of this session.
Before continuing to part 3 of the session, you may like to
repeat your calculations usingthe transmission parameters relating
to WAIFW A . You should find that the basicreproduction number
corresponding to this matrix is about 10.9. When doing this, you
willneed to ensure that infectious individuals are introduced into
each of the young, middle-aged and old age groups at the start, as
otherwise, the answer that you get may bemisleading.
Home Contents Module Map Glossary Tools Help
EPM302 Modelling and the Dynamics of Infectious Diseases
MD07 Calculating R0 for non-randomlymixing populations
-
prev next
21.1: Part 3 (Practical): Calculating R0 using the
simultaneousequations approach
page 79 of 97
As mentioned on page 49 , if we have a population in which
individuals are stratified intothree groups, e.g. the young,
middle-aged and old, the basic reproduction number can befound by
identifying the values x, w and R0 for which the following matrix
equation holds:
Equation A
This equation can be written out in full as follows:
Ryyx+Rymw+Ryoz = R0x Equation B
Rmyx+Rmmw+Rmoz = R0w Equation C
Royx+Romw+Rooz = R0z Equation D
where z = 1 - x - w.
Equation B is equivalent to saying that the total number of
young infectious individualsresulting from each infectious person
equals R0x.
Equation C is equivalent to saying that the total number of
middle-aged infectiousindividuals resulting from each infectious
person equals R0w.
Equation D is equivalent to saying that the total number of old
infectious individualsresulting from each infectious person equals
R0(1-x-w).
The values for x, w and z (=1-x-w) when all three equations B -
D hold simultaneouslyprovide the proportions of the typical
infectious person which is young, middle-aged andold
respectively.
We will now illustrate how values for x, w and R0 which satisfy
equations B - D can beobtained using the "Solver" option in
Excel.
Home Contents Module Map Glossary Tools Help
EPM302 Modelling and the Dynamics of Infectious Diseases
MD07 Calculating R0 for non-randomlymixing populations
-
prev next
Answer
21.2: Part 3 (Practical): Calculating R0 using the
simultaneousequations approach
page 80 of 97
1. Return to the spreadsheet that you were working with. If you
have already closed thefile, click here to open the file which you
should have developed by now. If youhave not yet done so, reset the
value for the proportion of the population which isimmune (in cell
F8) to zero. Select rows 30 and 43 together, click with the
rightmouse button and choose the "Unhide" option.
The layout of this section of the spreadsheet should resemble
what you see in the imagebelow. It contains the following:
a) Yellow cells containing the proportions x, w and z which are
currently set toequal 0.8, 0.15 and 0.05 respectively (see cells
F33, F34 and F35). These cellshave been assigned the names x_, y_
and z_ respectively.b) Lilac cells containing the following:
i) an initial estimate of 4 for R0 (called R0_est), andii) cells
which will eventually contain expressions for the number of
young,middle-aged and old infectious individuals resulting from
each infectiousperson using the left and right-hand side of
equations B-D .
Q3.1 With the current value for R0_est, x, w and z, how many
young infectious individualswill result from the introduction of an
infectious individual?
Home Contents Module Map Glossary Tools Help
EPM302 Modelling and the Dynamics of Infectious Diseases
MD07 Calculating R0 for non-randomlymixing populations
-
prev next
Show
Show
21.3: Part 3 (Practical): Calculating R0 using the
simultaneousequations approach
page 81 of 97
We now need to set up the left and right-hand side of equations
C and D in theappropriate cells in our spreadsheet and find values
for x, w, z and R0_est for which theleft-hand sides of Equations
C-D equal their right-hand sides.
2. Set up the appropriate expression in cell F40 for the number
of middle-agedindividuals resulting from the introduction of an
infectious individual into a totallysusceptible population, using
the left-hand side of equation C.
Click the button below to check your expressions for cell
F40.
3. Set up the appropriate expression in cell F41 for the number
of old infectiousindividuals resulting from the introduction of an
infectious individual into a totallysusceptible population, using
the left-hand side of equation D.
Click the button below to check your expression for cell
F41.
If your answers differ from the ones provided, click here to
open R0waifwb_solnd.xlsx,where you can check your equations.
Home Contents Module Map Glossary Tools Help
EPM302 Modelling and the Dynamics of Infectious Diseases
MD07 Calculating R0 for non-randomlymixing populations
-
prev next
Show
Show
21.4: Part 3 (Practical): Calculating R0 using the
simultaneousequations approach
page 82 of 97
4. Set up the appropriate expression in cell H40 for the number
of middle-agedindividuals resulting from the introduction of an
infectious individual into a totallysusceptible population, using
the right-hand side of equation C.
Click the button below to check your expression for cell
H40.
5. Set up the appropriate expression in cell H41 for the number
of old infectiousindividuals resulting from the introduction of an
infectious individual into a totallysusceptible population, using
the right-hand side of equation D.
Click the button below to check your expression for cell
H41.
If your answers differ from those provided, click here to open
R0waifwb_solne.xlsx,where you can check your equations.
Home Contents Module Map Glossary Tools Help
EPM302 Modelling and the Dynamics of Infectious Diseases
MD07 Calculating R0 for non-randomlymixing populations
-
prev next
21.5: Part 3 (Practical): Calculating R0 using the
simultaneousequations approach
page 83 of 97
We will now try to find the values for x, w, z and R0_est for
which the left-hand sides ofequations B-D equal the right-hand side
of these equations using Excels Solver option.
You may recall from MD04 that to identify optimal parameter
values using the Solverroutine, you need to provide the
following:
a) The location of a single cell which contains an expression
whose value you wantto maximise, minimise or to be set to some
value (specified under the "Set targetcell" option) andb) The
cell(s) which are allowed to change so that this maximum, minimum,
etc isattained (under the "By changing cells" option).
We first consider how we can set up a single cell containing an
expression which, whenminimised, contains the values for x, w and
R0_est that we need. We shall use anexpression obtained by summing
the squares of the difference between the values on theleft and
right hand side of the equations. The rationale for this expression
is described onthe next page.
Home Contents Module Map Glossary Tools Help
EPM302 Modelling and the Dynamics of Infectious Diseases
MD07 Calculating R0 for non-randomlymixing populations
-
prev next
21.6: Part 3 (Practical): Calculating R0 using the
simultaneousequations approach
page 84 of 97
The expressions that we will be using have been hidden and we
will first unhide them.
6. Return to your spreadsheet, select the range of cells J36:L42
and change the colorof these cells to be black.
Reminder: to change the colour of cells which you have selected,
click on the Home tab,click on the arrow part of the Fill color
button and choose the black box from thepalette of cell colours
available. Click on OK to continue.
The layout of the spreadsheet should resemble what you see in
the image below. Itcontains the following:
a) Cell K39 contains a formula for the sum squared of the
difference between thenumber of young infectious individuals
predicted using the left hand-side of equationB and that predicted
using the right-hand side of equation B.b) Cells K40 and K41 have
analogous formulae relating to equations C and D;c) Cell K42 holds
the sum of the cells K39, K40 and K41.
Home Contents Module Map Glossary Tools Help
EPM302 Modelling and the Dynamics of Infectious Diseases
MD07 Calculating R0 for non-randomlymixing populations
-
prev next
Answer
21.7: Part 3 (Practical): Calculating R0 using the
simultaneousequations approach
page 85 of 97
Q3.2 If R0_est were to equal the basic reproduction number and
if x, w, and z were toreflect the proportion of the typical
infectious person which is young, middle-aged and oldrespectively,
what should be the values of the expressions in the following
cells:
a) K39, K40, K41?b) K42 (i.e. the sum of cells K39, K40, and
K41)?
OPTIONAL CHECKYou can test your answer by typing in the values
for x, w and R0 which you obtai