Fits generalized Ornstein-Uhlenbeck-based Hansen models for multiple continuous characters evolving under discrete selective regimes.
OUwie.joint(phy, data, model=c("BM1","BMS","OU1","OUM","OUMV",
"OUMVr","OUMA","OUMAr","OUMVA","OUMVAr"), ntraits, allfree=TRUE,
simmap.tree=FALSE, root.age=NULL, scaleHeight=FALSE,
root.station=TRUE, mserr="none", diagn=FALSE, quiet=FALSE)a phylogenetic tree, in ape “phylo” format and with internal nodes labeled denoting the ancestral selective regimes.
a dataframe containing species information (see Details).
models to fit to comparative data (see Details).
a numeric indicating the number of traits to analyze.
a logical indicating whether the parameters vary across the multiple traits (see Details). The default is TRUE.
a logical indicating whether the input tree is in SIMMAP format. The default is FALSE.
indicates the age of the tree. This is to be used in cases where the "tips" are not contemporary, such as in cases for fossil trees. Default is NULL meaning latest tip is modern day.
a logical indicating whether the total tree height should be scaled to 1 (see Details). The default is FALSE.
a logical indicating whether the starting state, \(\theta_0\), should be estimated (see Details).
designates whether the data matrix contains measurement error for each species value ("known"). The default is "none".
a logical indicating whether the full diagnostic analysis should be carried out. The default is FALSE.
a logical indicating whether progress should be written to the screen. The default is FALSE.
OUwie.joint returns an object of class OUwie.joint. This is a list with elements:
the maximum log-likelihood.
Akaike information criterion.
Akaike information criterion corrected for sample-size.
The model being fit
The number of parameters counted in the model.
a matrix containing the maximum likelihood estimates of \(\alpha\) and \(\sigma^2\).
a matrix containing the maximum likelihood estimates of \(\theta\) and it standard error.
A vector of names for the different regimes
The indices of the parameters being estimated are returned. The numbers correspond to the row in the eigvect and can useful for identifying the parameters that are causing the objective function to be at a saddlepoint (see Details)
A logical indicating whether the input phylogeny is a SIMMAP formatted tree.
The user-supplied age at the root of the tree.
Internal settings of the likelihood search
User-supplied dataset
User-supplied tree
A logical indicating whether the starting state, \(\theta_0\), was estimated
The lower bound set
The upper bound set
Number of iterations of the likelihood search that were executed
Number of traits optimized
This function jointly estimates parameters under various likelihood models for several continuous characters evolving under discrete selective regimes. As with the regular OUwie function all that is required is a tree and a trait data.frame. The tree must be of class “phylo” and must contain the ancestral selective regimes as internal node labels. Internal node labels can be applied manually or from some sort of ancestral state reconstruction procedure (BayesTraits, ape, diversitree, SIMMAP, etc.), which would then be brought into OUwie. The trait data.frame must have column entries in the following order: [,1] species names, [,2] current selective regime, with all other columns containing the set of continuous traits to optimize jointly. Currently, this function does not allow for measurement error to be incorporated, but future versions will (mserr="known"). Finally, a user can simply specify a particular clade as being in a different selective regime, by inputting a pair of species whose mrca is the root of the clade of interest [e.g., clade=c("taxaA","taxaB")]. OUwie will automatically assign internal node labels and update the data matrix according to this clade designation.
Possible models are the same as before: single-rate Brownian motion (model=BM1), Brownian motion with different rate parameters for each state on a tree (model=BMS), Ornstein-Uhlenbeck model with a single optimum for all species (model=OU1), Ornstein-Uhlenbeck model with different state means and a single \(\alpha\) and \(\sigma^2\) acting all selective regimes (model=OUM), and new Ornstein-Uhlenbeck models that assume different state means as well as either multiple \(\sigma^2\) (model=OUMV), multiple \(\alpha\) (model=OUMA), or multiple \(\alpha\) and \(\sigma^2\) per selective regime (model=OUMVA). We also allow for several constrained models: a model that assumes different state means as well as multiple \(\sigma^2\) but keeps \(\alpha\) constant across all traits (model=OUMVr); a model that assumes different state means as well as either multiple \(\alpha\) but keeps \(\sigma^2\) constant across all traits (model=OUMAr). Finally, when allfree=FALSE, the model specified will be considered global and applied to all traits rather than estimating the same model separately for each trait.
Leslie, A.B., Beaulieu, J.M., Crane, P.R., and Donoghue, M.J. 2014. Cone size is related to branching architecture in conifers. New Phytologist doi:10.111/nph.12864.
Beaulieu J.M., Jhwueng D.C., Boettiger C., and O'Meara B.C. 2012. Modeling stabilizing selection: Expanding the Ornstein-Uhlenbeck model of adaptive evolution. Evolution 66:2369-2383.
# NOT RUN {
#data(tworegime)
#trait1 <- OUwie.sim(tree,trait, alpha=pp$solution[1,],
#sigma.sq=pp$solution[2,],theta=pp$theta[,1], theta0=pp$theta[1,1])
#trait2 <- OUwie.sim(tree,trait, alpha=pp$solution[1,],
#sigma.sq=pp$solution[2,],theta=pp$theta[,1], theta0=pp$theta[1,1])
#trait.multi <- cbind(trait[,1:2],trait1[,3],trait2[,3])
##Fit a global OUMV model applied to all traits:
#oumv.global <- OUwie.joint(tree,trait.multi, model="OUMV", ntraits=2, allfree=FALSE)
##Now fit a OUMV model applied to each separately, but optimized jointly:
#oumv.joint <- OUwie.joint(tree,trait.multi, model="OUMV", ntraits=2, allfree=TRUE)
# }
Run the code above in your browser using DataLab