setBAMMpriors(phy, total.taxa = NULL, traits=NULL, outfile = 'myPriors.txt',
Nmax = 1000, suppressWarning = FALSE)phylo, e.g., the phylogenetic tree you will analyze with BAMMNULL, then a vector is returned instead.TRUE, then the warning about setting the Poisson rate prior is suppressed. Only applies if outfile = NULL.outfile = NULL, then a named vector is returned.The general rules applied here are:
For the lambdaInitPrior, we estimate the speciation rate of the data under a pure birth model. We then set this prior to give an exponential distribution with a mean five times greater than this computed pure birth speciation estimate.
The lambdaShiftPrior is the standard deviation of the normal prior on the exponential change parameter k. We set the prior distribution based on the age of the root of the tree. We set the standard deviation of this distribution such that 2 standard deviations give a parameter that will yield a 90% decline in the initial speciation rate between the root of the tree and the tips. The basic model is lambda(t) = lambda_0 * exp(k * t). This is a straightforward calculation: let x = -log(0.1) / TMAX, where TMAX is the age of the tree. Then set the standard deviation equal to (x / 2).
We set muInitPrior equal to lambdaInitPrior.
For trait evolution, we first compute the maximum likelihood estimate of the variance of a Brownian motion process of trait evolution. The prior betaInitPrior is then set to an exponential distribution with a mean 5 times greater than this value (similar to what is done for lambda and mu, above).
This function generates an output file containing a prior parameters block that can be pasted directly into the priors section of your BAMM control file.
data(whales)
setBAMMpriors(phy = whales, total.taxa = 89, outfile = NULL)Run the code above in your browser using DataLab