Instructor Notes

Instructor notes

Contact matrices


Instructor Note



Instructor Note

R

# Generate the contact matrix for Zambia only
contact_data_zambia <- socialmixr::contact_matrix(
  survey = zambia_sa_survey,
  countries = "Zambia", # key argument
  age.limits = c(0, 20),
  symmetric = TRUE
)

OUTPUT

Removing participants without age information. To change this behaviour, set the 'missing.participant.age' option

OUTPUT

Removing participants that have contacts without age information. To change this behaviour, set the 'missing.contact.age' option

R

# Print the contact matrix for Zambia only
contact_data_zambia

OUTPUT

$matrix
         contact.age.group
age.group   [0,20)      20+
   [0,20) 3.650000 1.451168
   20+    1.988136 2.461856

$demography
   age.group population proportion  year
      <char>      <num>      <num> <int>
1:    [0,20)    8006201  0.5780636  2010
2:       20+    5843835  0.4219364  2010

$participants
   age.group participants proportion
      <char>        <int>      <num>
1:    [0,20)          180 0.08490566
2:       20+         1940 0.91509434

R

# Print the vector of population size for {epidemics}
contact_data_zambia$demography$population

OUTPUT

[1] 8006201 5843835


Simulating transmission


Instructor Note

Use slides to introduce the topics of:

  • Scenario modelling and
  • Contact matrix.

Then start with the livecoding.



Instructor Note

Make a pause.

Use slides to introduce the topics of:

  • Initial conditions and
  • Population structure.

Then continue with the livecoding.



Instructor Note

Make a pause.

Use slides to introduce the topics of:

  • Model parameters and
  • New infections.

Then continue with the livecoding.



Instructor Note

Stop the livecoding.

Suggest learners to read the rest of the episode.

Return to slides.



Choosing an appropriate model


Instructor Note

The focus of this tutorial is understanding existing models to decide if they are appropriate for a defined question.



Modelling interventions


Instructor Note

In this tutorial different types of intervention and how they can be modelled are introduced. Learners should be able to understand the underlying mechanism of these interventions (e.g. reduce contact rate) as well as how to implement the code to include such interventions.



Comparing public health outcomes of interventions


Instructor Note

In this tutorial we introduce the concept of the counter factual and how to compare scenarios (counter factual versus intervention) against each other.



Comparing vaccination strategies


Modelling disease burden


Instructor Note

Inline instructor notes can help inform instructors of timing challenges associated with the lessons. They appear in the “Instructor View”.



Instructor Note

R

# load contact and population data from socialmixr::polymod
polymod <- socialmixr::polymod
contact_data <- socialmixr::contact_matrix(
  polymod,
  countries = "United Kingdom",
  age.limits = c(0, 20, 40),
  symmetric = TRUE
)

# prepare contact matrix
contact_matrix <- t(contact_data$matrix)

# prepare the demography vector
demography_vector <- contact_data$demography$population
names(demography_vector) <- rownames(contact_matrix)

# initial conditions: one in every 1 million is infected
initial_i <- 1e-6
initial_conditions_inf <- c(
  S = 1 - initial_i, E = 0, I = initial_i, R = 0, V = 0
)

initial_conditions_free <- c(
  S = 1, E = 0, I = 0, R = 0, V = 0
)

# build for all age groups
initial_conditions <- rbind(
  initial_conditions_inf,
  initial_conditions_free,
  initial_conditions_free
)
rownames(initial_conditions) <- rownames(contact_matrix)

# prepare the population to model as affected by the epidemic
uk_population <- epidemics::population(
  name = "UK",
  contact_matrix = contact_matrix,
  demography_vector = demography_vector,
  initial_conditions = initial_conditions
)

# time periods
preinfectious_period <- 3.0
infectious_period <- 7.0
basic_reproduction <- 1.46

# rates
infectiousness_rate <- 1.0 / preinfectious_period
recovery_rate <- 1.0 / infectious_period
transmission_rate <- basic_reproduction / infectious_period

# run an epidemic model using `epidemic()`
output <- epidemics::model_default(
  population = uk_population,
  transmission_rate = transmission_rate,
  infectiousness_rate = infectiousness_rate,
  recovery_rate = recovery_rate,
  time_end = 600, increment = 1.0
)