rm(list = ls())
40 Experimenting with COVID Model Demography
In this lab, you will work modify the new demographic features of the COVID model to incorporate new features to the network model and epidemic model parameterization. This will provide some additional practice in working with nodal attributes in the context of demographics. The specific learning objectives for this lab are to:
- Practice adding and updating a nodal attribute;
- Simulating an epidemic model with different forms of age homophily with this new attribute.
40.1 Setup
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:
40.2 Lab Steps
- Start with the model code and module functions from the tutorial, and add a categorical age attribute,
age.grp
, that classifies everyone based on being an adult (18+) versus a minor (<18). This first should be added as a nodal attribute on the network withset_vertex_attribute
. You can create a single binary, 0/1, attribute based on the vector of ages withifelse
. - Edit the module functions to update this age attribute. There will be changes to the aging module (to recalculate age group over time), and the arrivals (birth) module (to append this new attribute as 0 to all incoming births). Add 1 or 2 summary statistics within the modules to validate this new age group approach.
- Change the network model parameterization to handle age mixing with this categorical attribute (hint:
nodematch
instead ofabsdiff
), and pick a target statistic that is reasonable (no right/wrong answers here, but extreme values might cause problems with the model fit). - Run the model with a single simulation to ensure that the simulations are behaving as expected.
40.3 Lab Questions
This lab has been more focused on the technical and computational aspects of modeling building. We suggest you review what you have learned so far about model extensions, including the EpiModel API rules.