fitDiscrete {geiger} | R Documentation |
Fits macroevolutionary models to phylogenetic trees
fitDiscrete(phy, data, model=c("ER", "SYM", "ARD"), treeTransform=c("none", "lambda", "kappa", "delta", "linearChange", "exponentialChange", "twoRate"), data.names=NULL, plotlnl=F, qLimits=c(0.0001, 1000), pLimits=c(0.00001, 10))
phy |
object of type phylo |
data |
Data vector (one trait) or matrix (multiple traits) |
model |
One of ER, SYM, or ARD; see below |
treeTransform |
Model for transforming the tree; see below |
data.names |
Tip names for data vector that match tree species; ignored if data includes names |
plotlnl |
Plot likelihood surface? Works only with models of two parameters or fewer. |
qLimits |
Vector giving minimum and maximum values for rate parameter q; used ONLY for plotting. |
pLimits |
Vector giving minimum and maximum values for whichever tree transformation parameter you're using; used ONLY for plotting. |
This function fits various likelihood models for discrete character evolution. Likelihood is maximized using the r function nlm. All of the models are continuous-time Markov models of trait evolution (see Yang 2006 for a good general discussion of this type of model). The function can handle traits with any number of character states, under a range of models. The character model is specified by the "model" argument:
The function returns a rate matrix, Q, giving the transition rates among the characters. The diagonals of this matrix are zero; this is only because the rows of the matrix sum to zero.
The treeTransform argument allows you to test models where rates vary across the tree. Options are:
Returns maximum likelihood value for q and selected parameters, along with the likelihood score. Sometimes, parameters are confounded!
Luke J. Harmon and R. E. Glor
Yang, Z. 2006. Computational Molecular Evolution. Oxford University Press: Oxford.
data(geospiza) attach(geospiza) gb<-as.factor(geospiza.data[,1]>4.2) names(gb)<-rownames(geospiza.data) fitDiscrete(geospiza.tree, gb) fitDiscrete(geospiza.tree, gb, treeTransform="lambda") fitDiscrete(geospiza.tree, gb, treeTransform="delta") fitDiscrete(geospiza.tree, gb, treeTransform="kappa") fitDiscrete(geospiza.tree, gb, treeTransform="linearChange") fitDiscrete(geospiza.tree, gb, treeTransform="exponentialChange") fitDiscrete(geospiza.tree, gb, treeTransform="twoRate")