Description Usage Arguments Value Author(s) References Examples
The function takes a phybreak
-object containing MCMC-samples, and returns for each host
the posterior infectors, with support per infector. That can be in the form of a list, with infectors ordered
by support, or in the form of a matrix with supports for all host-infector combinations (host in columns, infectors in rows).
1 2 3 | infectorsets(x, which.hosts = "all", percentile = 0.95,
minsupport = 0, samplesize = Inf, infector.name = TRUE,
support = c("proportion", "count"), output = c("list", "matrix"))
|
x |
An object of class |
which.hosts |
A vector with hosts (exact names or positions in the dataset), or |
percentile |
Return infectors ordered by support, until a cumulative support indicated by |
minsupport |
Only return infectors with more support than |
samplesize |
The number of samples to include (taken from the tail of the MCMC-chain). |
infector.name |
Whether to return the names of the infectors, or their position in the dataset. |
support |
Whether to return the support (= posterior probability) for each infector as a |
output |
Whether to return a |
A named list with data.frame
s, each with a vector of infectors and a vector of supports. Or a matrix with
supports for each host-infector pair.
Don Klinkenberg don@xs4all.nl
Klinkenberg et al. (2017) Simultaneous inference of phylogenetic and transmission trees in infectious disease outbreaks. PLoS Comput Biol, 13(5): e1005495.
1 2 3 4 5 6 7 | #First build a phybreak-object containing samples.
simulation <- sim_phybreak(obsize = 5)
MCMCstate <- phybreak(dataset = simulation)
MCMCstate <- burnin_phybreak(MCMCstate, ncycles = 20)
MCMCstate <- sample_phybreak(MCMCstate, nsample = 50, thin = 2)
infectorsets(MCMCstate)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.