Generate a single cluster of infections

simulate_general_outbreak_inner(
  cluster_id,
  sample_covariates_df,
  covariate_weights = NULL,
  max_size = 50
)

Arguments

cluster_id

ID of cluster

sample_covariates_df

data frame of covariates with pre-calculated probability of infection prob_inf

covariate_weights

default is NULL which draws uniformly at random with replacement from the sample_covariates_df. Otherwise, the weights are used.

max_size

maximum size of cluster

Value

data frame with the following columns

cluster_id

unique cluster ID

person_id

order of infection in the cluster

gen

generation number (>=0)

inf_id

ID of the infector

n_inf

number of people infected by person

cluster_pos

number of positive smears in the cluster

cluster_size

number in cluster

censored

whether the cluster end was censored or not

covariates

other covariates in sample_covariates_df

Details

randomly assigns covariates from sample_df. breadth not depth. Generate generation by generation as opposed to going up the branch til termination.