makeTTree: Simulate a transmission tree

Description Usage Arguments Value

View source: R/makeTTree.R

Description

Simulate a transmission tree

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
makeTTree(
  off.r,
  off.p,
  pi,
  w.shape,
  w.scale,
  ws.shape = w.shape,
  ws.scale = w.scale,
  maxTime = Inf,
  nSampled = NA
)

Arguments

off.r

First parameter of the negative binomial distribution for offspring number

off.p

Second parameter of the negative binomial distribution for offspring number

pi

probability of sampling an infected individual

w.shape

Shape parameter of the Gamma probability density function representing the generation time

w.scale

Scale parameter of the Gamma probability density function representing the generation time

ws.shape

Shape parameter of the Gamma probability density function representing the sampling time

ws.scale

Scale parameter of the Gamma probability density function representing the sampling time

maxTime

Duration of simulation (can be Inf)

nSampled

Number of sampled individuals (can be NA for any)

Value

A N*3 matrix in the following format with one row per infected host, first column is time of infection, second column is time of sampling, third column is infector


TransPhylo documentation built on April 20, 2021, 5:09 p.m.