estimateBound: Estimate a Uniform Distribution for MCMCtree

Description Usage Arguments Value Author(s) Examples

View source: R/estimateBound.R

Description

Estimate the paramaters of a soft-bounded uniform distribution and output trees for MCMCtree input

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
estimateBound(
  minAge,
  maxAge,
  minProb = 0.025,
  rightTail = 0.025,
  phy,
  monoGroups,
  writeMCMCtree = FALSE,
  plot = TRUE,
  MCMCtreeName = "bound.tre",
  pdfOutput = "uniformPlot.pdf"
)

Arguments

minAge

vector of minimum age bounds for nodes matching order in monoGroups

maxAge

vector of maximum age bounds for nodes matching order in monoGroups

minProb

probability of left tail (minimum bound) - default to hard minimum (minProb=0)

rightTail

probability of right tail (maximum bound default = 0.975)

phy

fully resolved phylogeny in ape format

monoGroups

list with each element containing species that define a node of interest

writeMCMCtree

logical whether to write tree in format that is compatible with MCMCTree to file

plot

logical specifying whether to plot to PDF

MCMCtreeName

MCMCtree.output file name

pdfOutput

pdf output file name

Value

list containing node estimates for each distribution

If plot=TRUE plot of distributions in file 'pdfOutput' written to current working directory

If writeMCMCtree=TRUE tree in MCMCtree format in file "MCMCtreeName" written to current working directory

Author(s)

Mark Puttick

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
data(apeData)
attach(apeData)
## extract taxon descending from calibrated nodes 8, 10, 11, 13
## these nodes can be visualised using plot.phylo
## and nodelabels from ape
monophyleticGroups <- tipDes(apeData$apeTree, c(8,10,11,13))
minimumTimes <- c("nodeOne"=15, "nodeTwo"=6,
"nodeThree"=8, "nodeFour"=13) / 10
maximumTimes <- c("nodeOne" = 30, "nodeTwo" = 12,
"nodeThree"=12, "nodeFour" = 20) / 10
estimateBound(minAge=minimumTimes, maxAge=maximumTimes, 
monoGroups=monophyleticGroups, phy=apeTree, plot=FALSE)$MCMCtree

PuttickMacroevolution/MCMCtreeR documentation built on Nov. 24, 2019, 5:22 a.m.