draw_sec_infects_df: Stage secondary infections when new cases are generated

Description Usage Arguments Value

View source: R/draw_distributions.R

Description

When a new case is generated, all the secondary infections are also generated and loaded into the state_df row for the primary case. The infections are only actually loaded into the simulation at the correct time, through the function generate_secondary_infections() in generate_new_infections.R. To generate secondary infections, first the number of potential secondary infections is drawn. Then, generation intervals are generated for each potential secondary infection. Finally, potential infections are rejected by user-defined criteria, such as being after the isolation time for the primary case. Currently, only one type of secondary infection algorithm is implemented (the one from Hellewell et al.). The generation intervals are generated by a call to draw_generation_interval.

Usage

1
draw_sec_infects_df(state_df, sim_params, sim_status, import = FALSE)

Arguments

state_df

state_df object for the newly generated cases

sim_params

sim_params object (a list) containing simulation parameters. Specifically, the sim_params$sec_infect_params object contains the parameters for generating secondary infections. This list should have the following entries:

  • type: Defines the algorithm to be used. Currently, only "Hellewell" is implemented. This uses a negative binomial distribution to draw the number of potential secondary infections with a mean equal to R0*contact_rate and a dispersion equal to the value set below. Generation intervals are drawn but only potential infections with generation intervals earlier than the primary case's time of isolation are kept.

  • disp: The dispersion value for the negative binomial distribution used to determine the number of potential secondary infections.

sim_status

sim_status object (a list) containing simulation state vector

import

A boolean indicating whether these new cases are imported cases instead of secondary infections. These cases may be required to self-isolate. Defaults to FALSE.

Value

A list containing


bcgov/epi.branch.sim documentation built on Dec. 16, 2020, 5:49 a.m.