runTwoStateGibbs: Gibbs sampler for a phylogenetic model with a binary trait.

Description Usage Arguments Value

Description

Runs a Gibbs sampler for a two-state CMTC on a set of phylogenetic trees, with data at the tips of the trees.

Usage

1
2
3
runTwoStateGibbs(inputTrees, rootDist, traitData, initLambda01, initLambda10,
  priorAlpha01, priorBeta01, priorAlpha10, priorBeta10, mcmcSize, mcmcBurnin,
  mcmcSubsample)

Arguments

inputTrees

multiPhylo object containing a list of trees.

rootDist

Numeric vector of size two with probabilities of the two states at the root of the tree.

traitData

Vector of trait values, coded as 0 and 1.

initLambda01

Initial value of the 0 -> 1 rate.

initLambda10

Initial value of the 1 -> 0 rate.

priorAlpha01

Shape parameter of the Gamma prior on the 0 -> 1 rate.

priorBeta01

Rate parameter of the Gamma prior on the 0 -> 1 rate.

priorAlpha10

Shape parameter of the Gamma prior on the 1 -> 0 rate.

priorBeta10

Rate parameter of the Gamma prior on the 0 -> 1 rate.

mcmcSize

Total number of MCMC iterations.

mcmcBurnin

Number of initial iterations to ignore.

mcmcSubsample

Integer controlling how many MCMC iterations to save. For example, mcmcSubsample = 10 saves every tenth iteration after ignoreing the first mcmcBurnin iterations.

Value

List with two elements: the input trees and a matrix of MCMC output. The columns of MCMC output matrix are Iteration number, Index of a tree that was sampled at this iteration, Log posterior, 0 -> 1 rate, 1 -> 0 rate, Number of 0 -> 1 jumps, Number of 1 -> 0 jumps, Time spent in state 0, Time spent in state 1


vnminin/indorigin documentation built on May 3, 2019, 6:17 p.m.