Description Usage Arguments Details Value Examples
View source: R/simulate_outbreak.R
Simulate the process of flipping until failure for K clusters
1 2 3 4 5 6 7 8 9 | simulate_outbreak(
K,
inf_params,
smear_pos_prob,
max_size = 50,
start_at_outsider = FALSE,
keep_zero_clusters = FALSE,
sample_covariates = NULL
)
|
K |
number of total clusters to simulate |
inf_params |
vector with beta_0 and beta_1 |
smear_pos_prob |
probability of a smear positsive |
max_size |
maximum size a cluster can be |
start_at_outsider |
if TRUE, we start at an unobserved outsider instead of a single index case |
keep_zero_clusters |
Do I keep track of the the cluster consisting only of the unobserved root node? Default is FALSE. |
sample_covariates |
used for multi-variate people |
breadth not depth. Generate generation by generation as opposed to going up the branch til termination.
data frame with the following columns
unique cluster ID
order of infection in the cluster
- 1 (negative) / + 1 (positive)
generation number (>=0)
ID of the infector
number of people infected by person
number of positive smears in the cluster
number in cluster
whether the cluster end was censored or not
1 2 3 4 5 6 7 8 | inf_params <- c("beta_0" = -2, "beta_1" = 1)
smear_pos_prob <- .8
max_size <- 30
K <- 5
out <- simulate_outbreak(K = K,
inf_params = inf_params,
smear_pos_prob = smear_pos_prob,
max_size = max_size)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.