transformPhylo.sim: Phylogenetic tree transformations

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

View source: R/transformPhylo.sim.R

Description

Simulates trait data on a tree using a specified model of evolution (see details).

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
transformPhylo.sim(
  phy,
  n = 1,
  x = NULL,
  model = NULL,
  returnNodes = FALSE,
  kappa = NULL,
  lambda = NULL,
  delta = NULL,
  alpha = NULL,
  psi = NULL,
  acdcRate = NULL,
  lambda.sp = NULL,
  trend = NULL,
  trend.anc.state = 0,
  nodeIDs = NULL,
  rateType = NULL,
  cladeRates = NULL,
  branchRates = NULL,
  rate = NULL,
  group.means = NULL,
  splitTime = NULL,
  timeRates = NULL,
  branchLabels = NULL,
  rate.var = NULL,
  mode.order = NULL
)

Arguments

phy

An object of class phylo (see ape).

n

Number of simulations

x

Vector, matrix or data.frame (with taxon names as names or rownames) of categories for each species. Only applicable if model="mixedRate"

model

The model of trait evolution (see details).

returnNodes

Logical. If TRUE, alongside the tip values all node values are returned corresponding to APE's edge.matrix for the tree.

kappa

Value of kappa transform.

lambda

Value of lambda transform.

delta

Value of delta transform.

alpha

Value of alpha (OU) transform.

psi

Value of psi transform. Note that 'original nodes' from the full phylogeny can be included as an element on the phylogeny (e.g., phy$orig.node) as well as estimates of 'hidden' speciation (e.g., phy$hidden.speciation) if estimates of extinction (mu) are > 0.

acdcRate

Value of ACDC transform.

lambda.sp

Estimate of speciation (lambda) for the psi models

trend

value of the expectation mean change through time

trend.anc.state

the expected ancestal state for the trend model (default is 0)

nodeIDs

Integer - ancestral nodes of clades.

rateType

If model="clade", a vector specifying if rate shift occurs in a clade ("clade") or on the single branch leading to a clade ("branch").

cladeRates

Numeric vector specifying telative rates for clades or logical to indicate scalar is included in the 'modeslice' model (the scalar is included in the mode.param argument with the 'modeslice' model).

branchRates

Numeric vector specifying relative rates for individual branches

rate

a vector of relative rate parameters. The length of the vector is equal to the number of rates being estimated.

group.means

a vector of the relative difference in means between rate categories, expressed as a scalar applied to the expected standard deviation (see Ricklefs 2006)

splitTime

A split time (measured from the present, or most recent species) at which a shift in the rate occurs for the "timeSlice" model

timeRates

The rates (from ancient to recent) for the timeSlice model

branchLabels

Branches on which different psi parameters are estimated in the "multipsi" model.

rate.var

Allows rate variation in BM modes in the 'modeslice' model

mode.order

The order of modes for the 'modeslice' model. Any combination of 'BM', 'OU', 'acdc', and 'kappa'

Value

Returns a matrix of simulated dated with taxon names as rownames (number of columns=n).

Author(s)

Gavin Thomas, Mark Puttick

References

Ricklefs RE. 2006. Time, species, and the generation of trait variation in clades. Systematic Biology 55, 151-159.

Ricklefs RE. 2006. Thomas GH, Meiri S, & Phillimore AB. 2009. Body size diversification in Anolis: novel environments and island effects. Evolution 63, 2017-2030

See Also

transformPhylo.ML, transformPhylo.ll, transformPhylo, transformPhylo.MCMC

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
data(anolis.tree)
data(anolis.data)

# Simulate 10 sets of data with kappa=0.1 using the anolis tree
sim.dat1 <- transformPhylo.sim(phy=anolis.tree, n=10, model="kappa", kappa=0.1)

# Simulate 10 sets of data where rates and means differ between to the categories defined by "x"
x <- anolis.data$geo_ecomorph
names(x) <-  rownames(anolis.data)
sim.dat2 <- transformPhylo.sim(phy=anolis.tree, n=10, x=x, model="mixedRate", rate=c(1,1,2,4),
group.means=c(0,5,0,0))

PuttickMacroevolution/motmot documentation built on June 5, 2020, 7 p.m.