sample.phybreak: Sampling from a phybreak MCMC-chain.

Description Usage Arguments Value Author(s) References Examples

View source: R/sample-phybreak.R

Description

Function to take (additional) samples from the posterior distribution of a phylogenetic and transmission tree (plus associated parameters), within a phybreak-object.

Usage

1
2
sample.phybreak(phybreak.object, nsample, thin = 1, keepphylo = NULL,
  phylotopology_only = 0)

Arguments

phybreak.object

An object of class phybreak.

nsample

The number of samples to take.

thin

The thinning to use (values after every thin'th iteration will be included in the posterior). Each iteration does one update of all parameters and tree updates with each host as focal host once.

keepphylo

The proportion of tree updates keeping the phylotree intact. If there is more than one sample per host, keepphylo should be 0. If set to NULL (default), this is done automatically, otherwise it is set to 0.2.

phylotopology_only

The proportion of tree updates in which only the within-host minitree topology is sampled, and the transmission tree as well as coalescence times are kept unchanged.

Value

The phybreak-object used to call the function, including (additional) samples from the posterior.

Author(s)

Don Klinkenberg don@xs4all.nl

References

Klinkenberg et al. (2017) Simultaneous inference of phylogenetic and transmission trees in infectious disease outbreaks. PLoS Comput Biol, 13(5): e1005495.

Examples

1
2
3
4
5
6
#First create a phybreak-object
simulation <- sim.phybreak(obsize = 5)
MCMCstate <- phybreak(data = simulation)

MCMCstate <- burnin.phybreak(MCMCstate, ncycles = 20)
MCMCstate <- sample.phybreak(MCMCstate, nsample = 50, thin = 2)

phybreak documentation built on May 2, 2019, 3:36 p.m.