| sim.history | R Documentation |
Simulates discrete character evolution on a phylogenetic tree.
sim.history(tree, Q, anc=NULL, nsim=1,
direction=c("column_to_row","row_to_column"), ...)
sim.Mk(tree, Q, anc=NULL, nsim=1, ...)
sim.multiMk(tree, Q, anc=NULL, nsim=1, ...)
tree |
a phylogenetic tree as an object of class |
Q |
a matrix containing the instantaneous transition rates between states. Note that for |
anc |
an optional value for the state at the root node; if |
nsim |
number of simulations. |
direction |
row/column direction of the input transition matrix, |
... |
other optional arguments. Currently only |
The function sim.history simulates a stochastic character history for a discretely valued character trait on the tree. The resultant tree is stored as a modified "phylo" object in stochastic character map (e.g., make.simmap) format.
The function sim.Mk simulates the states for a discrete character at the tips of the tree only.
Finally, the function sim.multiMk is the same as sim.Mk except that it permits the user to simulate under different values of Q in different parts of the tree.
sim.history returns an object of class "simmap" (a tree with a mapped discrete character) or "multiSimmap" for nsim greater than one.
sim.Mk and sim.multiMk return a factor with the states of our discrete character at the tips of the tree only.
Liam Revell liam.revell@umb.edu
Revell, L. J. (2024) phytools 2.0: an updated R ecosystem for phylogenetic comparative methods (and other things). PeerJ, 12, e16505.
fitMk, fitmultiMk, make.simmap, read.simmap, plotSimmap, sim.rates
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.