sim.convergence.geo: Simulation of trait data under the model of convergent...

View source: R/sim.convergence.geo.R

sim.convergence.geoR Documentation

Simulation of trait data under the model of convergent character displacement described in Drury et al. 2017

Description

Simulates the evolution of a continuous character that evolves depending on pairwise similarity in another, OU-evolving trait (e.g., a trait that covaries with resource use). sig2 and z0 are shared between two traits, max and alpha are for focal trait, OU parameters for non-focal trait

Usage


sim.convergence.geo(phylo,pars, Nsegments=2500, plot=FALSE, geo.object)

Arguments

phylo

an object of type 'phylo' (see ape documentation)

pars

A matrix with a number of rows corresponding to the desired number of simulations, columns containing values for sig2 in [,1], m in [,2], alpha in [,3], root.value in [,4], psi of the OU model for the non-focal, resource use trait in [,5], and theta in the OU model for the non-focal resource use trait in [,6]

Nsegments

the minimum number of time steps to simulate

plot

if TRUE, returns two plots: the top plot is focal trait undergoing convergence, the bottom plot is non-focal trait evolving under BM or OU

geo.object

geography object created using CreateGeoObject

Details

Adjusting Nsegments will impact the length of time the simulations take. The length of each segment (max(nodeHeights(phylo))/Nsegments) should be much smaller than the smallest branch (min(phylo$edge.length)).

Value

A list of two matrices with the simulated values for each lineage (one simulation per row; columns correspond to species) for trait1 (focul trait undergoing convergence) and non.focal (resource-use trait that determines strength of convergence in trait1)

Author(s)

J.P. Drury jonathan.p.drury@gmail.com

References

Drury, J., Grether, G., Garland Jr., T., and Morlon, H. 2017. A review of phylogenetic methods for assessing the influence of interspecific interactions on phenotypic evolution. Systematic Biology

See Also

CreateGeoObject

Examples



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

#simulate with the OU process present and absent
pars<-expand.grid(0.05,-0.1,1,0,c(2,0),0)
sim.convergence.geo(phylo,pars,Nsegments=2500, plot=FALSE, geo.object)



hmorlon/PANDA documentation built on March 8, 2024, 8:36 p.m.