In this lab, you will work to extend the network-based SEIR model into an SEIRS model by adding a transition for waning immunity. The specific learning objectives for this lab are to:

  1. Practice conceptualizing and coding an extension module for EpiModel;
  2. Practice running a model in browser mode for debugging purposes;
  3. Simulate an SEIRS model model with varying waning immunity rates.

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:

rm(list = ls())

Next, make sure that you have your module script and analysis run file from the SEIR Tutorial ready in your working directory.

Lab Steps

With your group, take the model in the SEIR Tutorial and extend it into an SEIRS model. Specific steps:

  1. Include an additional stochastic (with rbinom again) transition from R to S in the progression function. It is possible here to just copy and paste what is happening with the other transitions, and then modify the status attribute accordingly. You will need to update the get_ functions to pull a new parameter, rs.rate.
  2. Include epi summary stats for the new flow, rs.flow, at each time step.
  3. Source the model functions, and add a new parameter for the waning immunity rate, rs.rate, matching the model function.
  4. Run the model in browser mode to step through the new functionality.
  5. Comment out the browser line to stop running in debug mode, resource the module functions, update the control settings to run multiple simulations of the model under different waning immunity rates.

Lab Questions

After you have completed running the models above, please answer the following questions and discuss in your work group.

  1. What is the overall impact of varying waning immunity rates on the epidemic outcomes in this model?
  2. What are additional model components for this SEIRS model that may be missing that you would like to add? How/where would you add them under the EpiModel API?



Last updated: 2022-07-07 with EpiModel v2.3.0