Learn R Programming

RPANDA (version 1.2)

fit_t_comp: Fits models of trait evolution incorporating competitive interactions

Description

Fits matching competition (MC), diversity dependent linear (DDlin), or diversity dependent exponential (DDexp) models of trait evolution to a given dataset and phylogeny.

Usage

fit_t_comp(phylo,data,model=c("MC","DDexp","DDlin"),par=NULL,geography.object=NULL, method="Nelder-Mead",bounds=NULL)

Arguments

phylo
an object of type 'phylo' (see ape documentation)
data
a named vector of trait values with names matching phylo$tip.label
model
model chosen to fit trait data, "MC" is the matching competition model of Nuismer & Harmon 2014, "DDlin" is the diversity-dependent linear model, and "DDexp" is the diversity-dependent exponential model of Weir & Mursleen 2013.
geography.object
a list of sympatry through time created using CreateGeoObject
par
vector specifying starting parameter values for maximum likelihood optimization. If unspecified, default values are used (see Details)
method
method to use for ML optimization (default is Nelder-Mead)
bounds
optional list (default bounds are list(lower=-Inf,upper=Inf)) to be specified when using L-BFGS-B ML optimization method.

Value

a list with the following elements:
LH
maximum log-likelihood value
aic
Akaike Information Criterion value
aicc
AIC value corrected for small sample size
free.parameters
number of free parameters from the model
sig2
maximum-likelihood estimate of sig2 parameter
S
maximum-likelihood estimate of S parameter of matching competition model (see Note)
b
maximum-likelihood estimate of b parameter of linear diversity dependence model
r
maximum-likelihood estimate of r parameter of exponential diversity dependence model
r
maximum-likelihood estimate of z0, the value at the root of the tree
convergence
convergence diagnostics from optim function (see optim documentation)

Details

If unspecified, par takes the default values of var(data)/max(nodeHeights(phylo)) for sig2 and 0 for either S for the matching competition model, b for the linear diversity dependence model, or r for the exponential diversity dependence model. Values can be manually entered as a vector with the first element equal to the desired starting value for sig2 and the second value equal to the desired starting value for either S, b, or r. Note that, since the starting value for sig2 is exponentiated to stabilize the likelihood search, if you input a par value, the first value specifying sig2 should be the log of the desired starting value.

References

Drury, J., Clavel, J., Manceau, M., and Morlon, H. 2016. Estimating the effect of competition on trait evolution using maximum likelihood inference. Systematic Biology doi 10.1093/sysbio/syw020

Nuismer, S. & Harmon, L. 2015. Predicting rates of interspecific interaction from phylogenetic trees. Ecology Letters 18:17-27. Weir, J. & Mursleen, S. 2012. Diversity-dependent cladogenesis and trait evolution in the adaptive radiation of the auks (Aves: Alcidae). Evolution 67:403-416.

See Also

sim_t_comp CreateGeoObject likelihood_t_MC likelihood_t_MC_geog likelihood_t_DD likelihood_t_DD_geog

Examples

Run this code

data(Anolis.data)
geography.object<-Anolis.data$geography.object
pPC1<-Anolis.data$data
phylo<-Anolis.data$phylo


#Fit three models without biogeography to pPC1 data
MC.fit<-fit_t_comp(phylo,pPC1,model="MC")
DDlin.fit<-fit_t_comp(phylo,pPC1,model="DDlin")
DDexp.fit<-fit_t_comp(phylo,pPC1,model="DDexp")

#Now fit models that incorporate biogeography, NOTE these models take longer to fit
MC.geo.fit<-fit_t_comp(phylo,pPC1,model="MC",geography.object=geography.object)
DDlin.geo.fit<-fit_t_comp(phylo,pPC1,model="DDlin",geography.object=geography.object)
DDexp.geo.fit<-fit_t_comp(phylo,pPC1,model="DDexp",geography.object=geography.object)


Run the code above in your browser using DataLab