simulate_data_dates(day_adm, day_dis, p = 0.05, z = 0.8, b = 0.005, gamma = 0.3,
gamma_gl = 0.03, genpar = 0.8, testdays = 3, model = 2)
day_adm
.
epi
. Each column represents a day, spanning the interval over which data were collected. 0=Negative, 1=Positive, -1=MissingpatientseqIDs
.distmat
.genpar
. All hosts within the same transmission chain belong to the same group. Pairwise genetic distances are sampled from geometric distributions with parameters gamma
and gamma_gl
for within-group and between-group pairs respectively. Model 2 is the transmission chain model, in which genetic distances increase as hosts are further separated in the transmission tree. Genetic distances between hosts separated by k
transmission links are drawn independently from the geometric distribution with parameter gamma
x genpar
^k
. Genetic distances between hosts in independent transmission chains are drawn from a geometric distribution with parameter gamma_gl
.
simulate_data
to additionally generate admission and discharge dates.
admissions <- sort(sample(1:100,100, replace=TRUE))
discharge <- admissions + rpois(100,5) + 1
Tsim <- simulate_data_dates(day_adm=admissions, day_dis=discharge, p=0.1,b=0.01)
Run the code above in your browser using DataLab