fit_t_comp_subgroup: Fits models of trait evolution incorporating competitive...

Description Usage Arguments Details Value Note Author(s) References See Also Examples

View source: R/fit_t_comp_subgroup.R

Description

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

Usage

1
2
3
4
fit_t_comp_subgroup(full.phylo, ana.events, clado.events, stratified=FALSE, map,data, 
	trim.class, model=c("MC","DDexp","DDlin"), par=NULL, method="Nelder-Mead", 
	bounds=NULL)
	

Arguments

full.phylo

an object of type 'phylo' (see ape documentation) containing all of the tips used to estimate ancestral biogeography in BioGeoBEARS

ana.events

the "ana.events" table produced in BioGeoBEARS that lists anagenetic events in the stochastic map

clado.events

the "clado.events" table produced in BioGeoBEARS that lists cladogenetic events in the stochastic map

stratified

logical indicating whether the stochastic map was built from a stratified analysis in BioGeoBEARS

map

a phylo object created using make.simmap in phytools that contains reconstructed subgroup membership

data

a named vector of trait values for subgroup members with names matching full.phylo$tip.label

trim.class

subgroup whose members are competing

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.

par

vector specifying starting parameter values for maximum likelihood optimization. If unspecified, default values are used (see Details)

method

optimization algorithm to use (see optim)

bounds

(optional) list of bounds to pass to optimization algorithm (see details at optim)

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: since likelihood optimization uses sig rather than sig2, and since the starting value for is exponentiated to stabilize the likelihood search, if you input a par value, the first value specifying sig2 should be the log(sqrt()) of the desired sig2 starting value.

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

z0

maximum-likelihood estimate of z0, the value at the root of the tree

convergence

convergence diagnostics from optim function (see optim documentation)

Note

In current version, the S parameter is restricted to take on negative values in MC + geography ML optimization.

Author(s)

Jonathan Drury [email protected]

References

Drury, J., Tobias, J., Burns, K., Mason, N., Shultz, A., and Morlon, H. in review. Contrasting impacts of competition on ecological and social trait evolution in songbirds. PLOS Biology.

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

likelihood_subgroup_model CreateGeobyClassObject

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
data(BGB.examples)


Canidae.phylo<-BGB.examples$Canidae.phylo
dummy.group<-c(rep("B",3),rep("A",12),rep("B",2),rep("A",6),rep("B",5),rep("A",6))
names(dummy.group)<-Canidae.phylo$tip.label


Canidae.simmap<-phytools::make.simmap(Canidae.phylo,dummy.group)

set.seed(123)
Canidae.data<-rnorm(length(Canidae.phylo$tip.label))
names(Canidae.data)<-Canidae.phylo$tip.label
Canidae.A<-Canidae.data[which(dummy.group=="A")]

fitA<-fit_t_comp_subgroup(full.phylo=Canidae.phylo,ana.events=BGB.examples$Canidae.ana.events, 
clado.events=BGB.examples$Canidae.clado.events,stratified=FALSE,map=Canidae.simmap, 
data=Canidae.A,trim.class="A",model="DDexp")
	

hmorlon/PANDA documentation built on Nov. 8, 2018, 12:32 p.m.