coalescentMCMC (version 0.4-1)

treeOperators: Trees Operators for Running MCMC

Description

These functions provide tools for tree rearrangement to be used as operators in a MCMC run.

Usage

NeighborhoodRearrangement(phy, n, nodeMax, target, THETA, brtimes)
TipInterchange(phy, n)
EdgeLengthJittering(phy)

Arguments

phy

a tree of class "phylo".

n

the number of tips in phy.

nodeMax

the largest (integer) value of the node coding in phy.

target

the number of the node where the rearrangement will be done.

THETA

The estimate of \(\Theta\) for phy at the node 'target'.

brtimes

the branching times of phy.

Value

an object of class "phylo".

Details

NeighborhoodRearrangement performs a rearrangement as described by Kuhner et al. (1995).

TipInterchange interchanges two tips under the condition that they are not sisters.

EdgeLengthJittering alters the branch lengths by adding a random value from a uniform distribution defined by range(phy$edge.length) (the ultrametric nature of the tree is conserved).

References

Kuhner, M. K., Yamato, J. and Felsenstein, J. (1995) Estimating effective population size and mutation rate from sequence data using Metropolis-Hastings sampling. Genetics, 140, 1421--1430.

See Also

coalescentMCMC, dcoal

Examples

Run this code
# NOT RUN {
tr <- rcoal(10)
ts <- NeighborhoodRearrangement(tr, 10, 19, 15, 1, branching.times(tr))
layout(matrix(1:2, 2))
plot(tr); plot(ts)
layout(1)
# }

Run the code above in your browser using DataLab