In this lab, you can work to extend the network-based SEIR model into an SEIRS model by adding a transition for waning immunity.

37.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:

Code
rm(list = ls())

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

37.2 Lab Steps

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.

37.3 Lab Questions

After you have completed running the models above, please consider the following questions.

  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?