thin_phybreak: Remove posterior samples from a phybreak-object.

Description Usage Arguments Value Author(s) References Examples

View source: R/thin-phybreak.R

Description

The function removes (all or some) posterior samples by thinning and/or removing the first part of the chain, but keeps the state of variables and parameters intact.

Usage

1
thin_phybreak(x, thin = 1, nkeep = Inf)

Arguments

x

An object of class phybreak.

thin

The thinning interval to use.

nkeep

the number of most recent samples to keep. If nkeep = Inf (default), the whole chain is thinned and returned. Otherwise, samples from the tail are kept.

Value

The phybreak-object provided as input, but with fewer posterior samples.

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
7
#First create a phybreak-object
simulation <- sim.phybreak(obsize = 5)
MCMCstate <- phybreak(data = simulation$sequences, times = simulation$sample.times)
MCMCstate <- burnin.phybreak(MCMCstate, ncycles = 20)
MCMCstate <- sample.phybreak(MCMCstate, nsample = 50, thin = 2)

MCMCstate <- thin_phybreak(MCMCstate, thin = 2)

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