estimateCauchy: Estimate Cauchy Distribution for MCMCTree

Description Usage Arguments Value Examples

View source: R/estimateCauchy.R

Description

Estimate the offset and scale paramaters of a soft-tailed cauchy distribution and output trees for MCMCTree input

Usage

1
2
3
4
estimateCauchy(minAge, maxAge, phy, monoGroups, scale = 0.2, offset = 0.1,
  estimateScale = T, minProb = 0, maxProb = 0.975, plot = FALSE,
  pdfOutput = "cauchyPlot.pdf", writeMCMCTree = FALSE,
  mcmcTreeName = "cauchyInput.tre")

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

phy

fully resolved phylogeny in ape format

monoGroups

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

scale

scale value for cauchy distribution (default = 1.5) (c in PAML manual page 49)

offset

offset value for cauchy distribution (default = 50) (p in PAML manual page 49)

estimateScale

logical specifying whether to estimate scale with a given shape value (default = TRUE)

minProb

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

maxProb

probability of right tail (maximum bound. default = 0.975)

plot

logical specifying whether to plot to PDF

pdfOutput

pdf output file name

writeMCMCTree

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

mcmcTreeName

mcmcTree 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

Examples

1
2
3
4
5
6
7
8
9
apeTree <- read.tree(text="((((human, (chimpanzee, bonobo)), gorilla), (orangutan, sumatran)), gibbon);")
monophyleticGroups <- list()
monophyleticGroups[[1]] <- c("human", "chimpanzee", "bonobo", "gorilla", "sumatran", "orangutan", "gibbon")
monophyleticGroups[[2]] <- c("human", "chimpanzee", "bonobo", "gorilla")
monophyleticGroups[[3]] <- c("human", "chimpanzee", "bonobo")
monophyleticGroups[[4]] <- c("sumatran", "orangutan")
minimumTimes <- c("nodeOne"=15, "nodeTwo"=6, "nodeThree"=8, "nodeFour"=13) / 10
maximumTimes <- c("nodeOne"=30, "nodeTwo"=12, "nodeThree"=12, "nodeFour"=20) / 10
estimateCauchy(minAge=minimumTimes, maxAge=maximumTimes, monoGroups=monophyleticGroups, offset=0.5, phy=apeTree, plot=F)

PuttickMacroevolution/MCMCTreeR documentation built on Nov. 20, 2017, 2:22 p.m.