This function takes an object of class "simmap"
with a mapped binary or multistate trait and data for an arbitrary number of continuously valued character. It then fits the multiple evolutionary variance-covariance matrix (rate matrix) model of Revell & Collar (2009; Evolution).
evol.vcv(tree, X, maxit=2000, vars=FALSE, ...)
an object of class "simmap"
. If tree
is an object of class "phylo"
then a simple multivariate Brownian motion model will be fit to the data in X
.
an n
x m
matrix of tip values for m
continuously valued traits in n
species - row names should be species names. If X
is supplied as a data frame it will be coerced into a matrix without warning.
an optional integer value indicating the maximum number of iterations for optimization. This quantity may need to be increased for difficult optimizations.
an optional logical value indicating whether or not to estimate the variances of the parameter estimates from the Hessian matrix.
optional arguments.
An object of class "evol.vcv"
with the following components:
vcv matrix for the single rate matrix model.
optionally, a matrix containing the variances of the elements of R.single
.
log-likelihood for single matrix model.
number of parameters in the single marix model.
m
x m
x p
array containing the p
estimated vcv matrices for the p
regimes painted on the tree.
optionally, an array containing the variances of the parameter estimates in R.multiple
.
log-likelihood of the multi-matrix model.
number of parameters estimated in this model.
P-value of the \(\chi^2\) test on the likelihood ratio.
logical value indicating whether or not the optimization has converged.
This function performs optimization by maximizing the likelihood with respect to the Cholesky matrices using optim
. Optimization is by method="Nelder-Mead"
. Using box constraints does not make sense here as they would be applied to the Cholesky matrix rather than the target parameters. Users may have to increase maxit
for large trees and/or more than two traits.
Revell, L. J., and D. C. Collar (2009) Phylogenetic analysis of the evolutionary correlation using likelihood. Evolution, 63, 1090-1100.
Revell, L. J. (2012) phytools: An R package for phylogenetic comparative biology (and other things). Methods Ecol. Evol., 3, 217-223.
# NOT RUN {
## load data from Revell & Collar (2009)
data(sunfish.tree)
data(sunfish.data)
## fit multi-correlation model
sunfish.fit<-evol.vcv(sunfish.tree,sunfish.data[,2:3])
print(sunfish.fit)
# }
Run the code above in your browser using DataLab