Initialize a model (agents and network).

setup_model(
  agent_count,
  age_dist,
  p_female,
  seir_dist,
  p_med_cond,
  p_symptomatic,
  trans_df = NULL,
  prog_df = NULL,
  home_nw_params = NULL,
  social_nw_params = NULL,
  work_nw_params = NULL
)

Arguments

agent_count

The number of agents to generate parameters for.

age_dist

A function to sample from a probability distribution or else a vector or list of ages. The vector will be repeated if necessary to produce enough agents.

p_female

A probability of being female or else a vector or list of sexes ("M" or "F") or logical (TRUE for female, FALSE for male). The vector will be repeated if necessary to produce enough agents.

seir_dist

A function to sample from a probability distribution or else a vector or list of SEIR statuses ("S", "E", "I", or "R"). The vector will be repeated if necessary to produce enough agents.

p_med_cond

A probability of having a medical condition or else a vector or list of medical conditions (logical: TRUE or FALSE). The vector will be repeated if necessary to produce enough agents.

p_symptomatic

A probability of being symptomatic if infectious, or else a vector or list of symptomatic status if infectious (logical: TRUE or FALSE). The vector will be repeated if necessary to produce enough agents.

trans_df

A data frame of parameters for disease transmission probability distributions. Columns are:

  • age_bkt: The age bracket (ordered factor).

  • sex: The sex (factor with levels "M" and "F").

  • med_cond: Has a medical condition (logical).

  • sympt: Has symptoms of COVID-19, if infectious (logical).

  • mu_shed: Mean of the shedding parameter distribution.

  • sigma_shed: Scale (standard deviation) of the shedding parameter distribution.

  • mu_susc: Mean of the susceptibility parameter distribution

  • sigma_susc: Scale (standard deviation) of the susceptibility parameter distribution.

prog_df

A data frame of parameters for disease progression probability distributions. Columns are:

  • age_bkt: The age bracket (ordered factor).

  • sex: The sex (factor with levels "M" and "F").

  • med_cond: Has a medical condition (logical).

  • sympt: Has symptoms of COVID-19, if infectious (logical).

  • shape_ei: Shape parameter for progression from "E" to "I" compartment.

  • scale_ei: Scale parameter for progression from "E" to "I" compartment.

  • shape_ir: Shape parameter for progression from "I" to "R" compartment.

  • scale_ir: Scale parameter for progression from "I" to "R" compartment.

home_nw_params

A named list with parameters for the home-contacts network. The list should have elements:

  • freq: The frequency of contacts in the network (contacts per day)

  • intens: The intensity of contacts in the network

  • topol: The topology of the network: "smallworld" or "Barabasi Albert".

  • nbrw: The size of the neighborhood (small world) or the number of edges to add per time step (BA).

  • p_rewire: The probability of rewiring an edge (small world) or the power of the preferential attachments (BA).

social_nw_params

A named list with parameters for social contacts.

work_nw_params

A named list with parameters for work contacts.

Value

A named list of the model: agents, network, contagion probabilities for disease transmission, and transition probabilities for progress to the next stage of the disease.

Examples

# ADD_EXAMPLES_HERE