|
a |
|
b/man/sim_ctd.Rd |
|
|
1 |
% Generated by roxygen2: do not edit by hand |
|
|
2 |
% Please edit documentation in R/sim_ctd.R |
|
|
3 |
\name{sim_ctd} |
|
|
4 |
\alias{sim_ctd} |
|
|
5 |
\title{Simulate contact data from a transmission tree} |
|
|
6 |
\usage{ |
|
|
7 |
sim_ctd(tTree, eps, lambda) |
|
|
8 |
} |
|
|
9 |
\arguments{ |
|
|
10 |
\item{tTree}{a dataframe or matrix of two columns, with each row providing |
|
|
11 |
the ids (numerical or as characters) of a transmission pair} |
|
|
12 |
|
|
|
13 |
\item{eps}{the contact reporting coverage, defined as the probability of |
|
|
14 |
reporting a contact (transmission pair or not)} |
|
|
15 |
|
|
|
16 |
\item{lambda}{the non-infectious contact rate, defined as the probability |
|
|
17 |
of contact between a non-transmission pair.} |
|
|
18 |
} |
|
|
19 |
\description{ |
|
|
20 |
This function simulates contact data from a transmission tree. The |
|
|
21 |
model assumes that all transmission pairs have experienced contact, and that |
|
|
22 |
there is no false-positive reporting of contacts. The probability of contact |
|
|
23 |
occuring between a non-transmision pair is given by the parameter lambda. The |
|
|
24 |
probability of reporting a contact (transmission pair or not) is given by the |
|
|
25 |
parameters eps. |
|
|
26 |
} |
|
|
27 |
\examples{ |
|
|
28 |
|
|
|
29 |
## load data |
|
|
30 |
x <- fake_outbreak |
|
|
31 |
tTree <- data.frame(from = x$ances, to = seq_along(x$ances)) |
|
|
32 |
|
|
|
33 |
## simulate contact data with coverage of 80\% and 10\% probability of |
|
|
34 |
## contact between non-transmission pairs |
|
|
35 |
ctd <- outbreaker2:::sim_ctd(tTree, eps = 0.8, lambda = 0.1) |
|
|
36 |
|
|
|
37 |
## inspect contact data |
|
|
38 |
head(ctd) |
|
|
39 |
} |
|
|
40 |
\author{ |
|
|
41 |
Finlay Campbell (\email{finlaycampbell93@gmail.com}) |
|
|
42 |
} |