Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

sim.ratebystate

Conduct simulation of state dependent rate variation


Description

This function attempts to simulate two characters under a model in which the rate of evolution for the second (y) depends on the states for the first (x). See ratebystate for more details.

Usage

sim.ratebystate(tree, sig2x=1, sig2y=1, beta=c(0,1), ...)

Arguments

tree

phylogenetic tree.

sig2x

variance of the Brownian process of evolution for x, σ_x^2.

sig2y

variance of the Brownian process of evolution for y when x-min(x)==1 (for logarithm=FALSE) or x==0 (for logarithm=TRUE).

beta

intercept and slope of the relationship between the value of x and the Brownian rate in y.

...

optional arguments which include method ("by.node" or "by.branch" indicating whether to assume the rate varies as a function of the node state or the mean branch state); plot, a logical value indicating whether or not to plot a phenogram with the branches used for simulation of y after rescaling by the state of x; and logarithm, a logical value indicating whether or not simulate changes in the variance of Brownian evolution for y as an additive logarithm=FALSE or multiplicative function of x. The default is logarithm=FALSE.

Value

This function returns a matrix.

Author(s)

References

Revell, L. J. (2012) phytools: An R package for phylogenetic comparative biology (and other things). Methods Ecol. Evol., 3, 217-223.

See Also


phytools

Phylogenetic Tools for Comparative Biology (and Other Things)

v0.7-70
GPL (>= 2)
Authors
Liam J. Revell
Initial release
2020-9-19

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.