Learn R Programming

ratematrix (version 1.2.5)

mergePosterior: Merge posterior distributions

Description

Join two or more independent MCMC chains from the same data and phylogenetic trees by appending them together into a single chain.

Usage

mergePosterior(...)

Value

A merged posterior distribution in the same format.

Arguments

...

any number of posterior distributions as produced by the function 'readMCMC'.

Author

Daniel S. Caetano and Luke J. Harmon

Examples

Run this code
# \donttest{
data( centrarchidae )
## Run multiple MCMC chains.
handle.list <- lapply(1:4, function(x) ratematrixMCMC(data=centrarchidae$data
                      , phy=centrarchidae$phy.map, gen=10000, dir=tempdir()) )
## Read all to a list
posterior.list <- lapply(handle.list, readMCMC)
## Merge all posteriors in the list.
merged.four <- mergePosterior(posterior.list)
## Merge some of the posteriors.
merged.two <- mergePosterior(posterior.list[[1]], posterior.list[[3]])
# }

Run the code above in your browser using DataLab