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
2
## S3 method for class 'phybreak'
thin(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(dataset = simulation)
MCMCstate <- burnin_phybreak(MCMCstate, ncycles = 20)
MCMCstate <- sample_phybreak(MCMCstate, nsample = 50, thin = 2)

MCMCstate <- thin.phybreak(MCMCstate, thin = 2)

donkeyshot/phybreak documentation built on Sept. 17, 2021, 9:32 p.m.