Description Usage Arguments Details Value Examples
View source: R/transmissionanalysis.r
MCMC algorithm to sample transmission parameters, infection times and transmission routes.
1 2 3 4 5 | transmission_analysis(epidata, distmat, seqIDs, resmat, iterations = 1e+05,
augmoves = 10, feedb = 1, tag = 1, noaug = 1, model = 2, path = NULL,
sensprior = c(1, 1), impprior = c(1, 1), betaprior = 1e+06,
gammaprior = c(1, 1), gammaGprior = c(1, 1), tparprior = 1e+06,
sigma = c(0.004, 0.03, 0.005, 0.25))
|
epidata |
Epidemiological data, in the form of an integer matrix consisting of columns: patient ID, day of admission, day of discharge. |
distmat |
Genetic distance matrix. Entry [i,j] provides the pairwise SNP distance between patients |
seqIDs |
Vector of patient IDs corresponding to the rows and columns of |
resmat |
Matrix of test results, each row corresponding to the patient ID in |
iterations |
Number of iterations for the MCMC algorithm to run. |
augmoves |
Number of data augmentation moves to make per MCMC iteration. |
feedb |
Frequency of console feedback; provided every 10^ |
tag |
Integer tag to attach to output file. |
noaug |
Level of data augmentation. 0=none, 1=sample infection times and routes for patients with positive swabs only, 2=sample infection times and routes for all patients. |
model |
Genetic diversity model to use. 1=importation clustering model, 2=transmission chain diversity model. |
path |
Location to store output files. |
sensprior |
Prior Beta distribution parameters for test sensitivity ( |
impprior |
Prior Beta distribution parameters for importation probability ( |
betaprior |
Prior exponential distribution mean for transmission rate ( |
gammaprior |
Prior Beta distribution parameters for within host/group genetic diversity ( |
gammaGprior |
Prior Beta distribution parameters for between host/group genetic diversity ( |
tparprior |
Prior exponential distribution mean for |
sigma |
Vector of initial variances for Normal proposal distributions for |
MCMC algorithm runs in C, and writes output file to specified path
.
Returns a matrix in which each row corresponds to MCMC iteration. Columns are as follows: p, z, beta, gamma, gamma_gl, genpar, number of importations, number of acquisitions, number of groups, likelihood, infection source [cols 11:(n+10)], infection group [cols (n+10):(2n+10)].
1 2 3 4 5 6 7 8 9 | ## Not run:
data(hospitaldata)
# Short example run
mcmcoutput <- transmission_analysis(epidata=hospitaldata$epi, distmat=hospitaldata$distmat,
seqIDs=hospitaldata$patientseqIDs, resmat=hospitaldata$resmat,
path=getwd(), iterations=10000, augmoves=5)
traceplots(mcmcoutput)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.