In this lab, you will work to simulate your first network-based epidemic model! The basic goal here will be to take the concepts and technical methods you have learned so far to extend the model in the previous tutorial. The specific learning objectives for this lab are to:
You can decide the best way to work together, but one option is to have one person share their screen, one person have the lab steps (below) up to read to the group, and others either coding along with the screen sharer or taking notes.
Once you are ready, start out by clearing your R object environment, to make sure that you do not have any objects lingering from the tutorial. This can be accomplished with:
rm(list = ls())
When you are plotting your figures below, you can switch between
single and double panel plots with the graphical parameter
mfrow
, like this:
# single panel
par(mfrow = c(1,1))
# double panel
par(mfrow = c(1,2))
To modify the plot margins, you can use the mar
parameter (this may need to be set after plotting the networks with zero
margins):
par(mar = c(3,3,2,1))
The four numbers correspond to the amount of space on the right, bottom, left, and top, in that order.
The model in Session 2 used a parameter for concurrency (degree of 2+) based on an estimate that 22% of the population had overlapping relations. What would happen to the epidemic trajectory relative to the outcomes presented in the tutorial if concurrency was prohibited but the mean degree remained constant?
netest
), and diagnose it (netdx
).
Do you need the degrange
term in the model now? How does
the degree distribution (count of nodes with degree 0, 1, 2, 3, 4…)
change here compared to the tutorial?netsim
by specifying an ncores
value (the default is 1).After you have completed running the models above, please answer the following questions and discuss in your work group.
Last updated: 2022-07-07 with EpiModel v2.3.0