Differential modeling of infection and vaccine derived NATs

safir allows differential modeling of decay from vaccine and infection derived neutralizing antibody titre (NAT). To use this feature, set up the model in the same way as outline in the “Natural Immunity” vignette with the following changes:

  1. After all parameters have been made, use make_independent_vaccine_infection_nat_parameters and assign the output to the same parameters object, e.g. parameters <- make_independent_vaccine_infection_nat_parameters(parameters, ...). It takes several arguments, dr_vec_doses will be a matrix where each column corresponds to a dose, and rows are days. The [i,j]-th element then corresponds to the decay rate on the i-th day since receiving dose j. dr_vec_inf is a vector giving daily decay for infection derived NAT, and max_ab_inf is the maximum value allowed for infection-derived NAT (on natural log scale).
  2. After all variables have been made, call create_independent_nat_variables and assign the output to the same variables object, e.g. variables <- create_independent_nat_variables(variables = variables, parameters = parameters). This adds a new DoubleVariable object that stores the NAT derived from infection separately.
  3. Instead of using attach_event_listeners_natural_immunity, please use attach_event_listeners_independent_nat. This makes sure that upon recovery from an infection bout, a person’s infection-derived NAT boost is added to the variable specifically for infection-derived NAT values.
  4. Instead of using natural_immunity_ab_titre_process, please use independent_ab_titre_process. This calculates decay for the two NAT types properly using their specific parameters.

I have listed the specific functions, variables, and parameters that were modified to incorporate this feature in this GitHub issue.

This feature will not conflict with the other versions of the model (i.e. it is backwards compatible). All previous vignettes and examples should still run the way one would expect. If you find a bug or strange behavior, please make a GitHub issue, and also be sure to check that the two decay parameters and NAT boosts (mu_ab_infection in function make_immune_parameters and mu_ab_list in get_vaccine_ab_titre_parameters) are designed such that adding together the two NAT values prior to calculating efficacy makes sense.

Time varying parameters

In addition to allowing time varying reproductive numbers via average contact rates, safir also supports time varying probabilities of hospitalization, severe disease, and disease outcomes, to support modeling of healthcare changes and variants.

By default safir uses the following parameters from squire, and all of them are vectors where each element gives the relevant probability for each age group. By default safir also uses these vectors, but it also accepts each parameter as a matrix as well. In this case, the rows correspond to age groups and the columns correspond to days (not time steps).

  1. parameters$prob_hosp: P(severe disease | exposure); this probability governs the chance that the exposed person will require hospitalization.
  2. parameters$prob_asymp: P(asymptomatic | mild disease); if the exposed person does not need hospitalization, this probability gives the chance they will be asymptomatic versus mildly symptomatic.
  3. parameters$prob_severe P(require ICU | hospitalized); if in hospital, does this person require an ICU bed (i.e. mechanical ventilation)?
  4. parameters$prob_severe_death_treatment P(death | require ICU, gets bed); if this person gets an ICU bed, will they die?
  5. parameters$prob_severe_death_no_treatment P(death | require ICU, don’t get bed); if this person doesn’t get an ICU bed, will they die?
  6. parameters$prob_non_severe_death_treatment P(death | require hosp, get bed); if in hospital but does not require ICU bed, will this person die?
  7. parameters$prob_non_severe_death_no_treatment P(death | require hosp, don’t get bed); if needs a hospital (but not ICU bed) but does not recieve one, will this person die?