estimateGamma: Estimate Gamma Distribution for MCMCtree analysis

Description Usage Arguments Value Author(s) Examples

Description

Estimate the shape and rate paramaters of Gamma distribution and output trees for MCMCtree input

Usage

1
2
3
4
estimateGamma(minAge, maxAge, phy, monoGroups, alpha = 188,
  beta = 2690, offset = 0.1, estimateAlpha = TRUE,
  estimateBeta = FALSE, plot = FALSE, pdfOutput = "gammaPlot.pdf",
  writeMCMCtree = FALSE, MCMCtreeName = "gammaInput.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

alpha

alpha value for gamma distribution (default = 188)

beta

beta value for gamma distribution (default = 2690)

offset

distance of mean value from minimum bound

estimateAlpha

logical specifying whether to estimate alpha with a given beta value (default = TRUE)

estimateBeta

logical specifying whether to estimate beta with a given alpha value (default = FALSE)

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

Author(s)

Mark Puttick

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
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("8"=15, "10"=6,
"11"=8, "13"=13) / 10
maximumTimes <- c("8" = 30, "10" = 12,
"11"=12, "13" = 20) / 10
gamma.nodes <- estimateGamma(minAge=minimumTimes, maxAge=maximumTimes, 
monoGroups=monophyleticGroups, alpha=188, beta=2690, 
offset=0.1, phy=apeTree, plot=FALSE)
gamma.nodes

MCMCtreeR documentation built on May 22, 2019, 1:03 a.m.