Q="empirical"
, it first fits a continuous-time reversible Markov model for the evolution of x
and then simulates stochastic character histories using that model and the tip states on the tree. This is the same procedure that is described in Bollback (2006), except that simulation is performed using a fixed value of the transition matrix, Q
, instead of by sampling Q
from its posterior distribution.
For Q="mcmc"
, it first samples Q
nsim
times from the posterior probability distribution of Q
using MCMC, then it simulates nsim
stochastic maps conditioned on each sampled value of Q
.
For Q
set to a matrix, it samples stochastic mappings conditioned on the fixed input matrix.make.simmap(tree, x, model="SYM", nsim=1, ...)
"phylo"
, or a list of trees as an object of class "multiPhylo"
.ace
.tree
is an object of class "multiPhylo"
, then nsim
simulations will be conducted per tree.pi
gives the prior distribution on the root node of the tree - options are "equal"
, "estimated"
, or a vector with the frequencies. If pi="estimated"
then the stationary distri"phylo"
(or a modified "multiPhylo"
object, for nsim
> 1) with the following additional elements:Q
.Q
.ace
(by Paradis et al.) to perform Felsenstein's pruning algorithm & compute the likelihood.
As of phytools>=0.2-33 x
can be a vector of states or a matrix containing the prior probabilities of tip states in rows. In this case the column names of x
should contain the states, and the row names should contain the tip names.
Note that there was a small (but potentially significant) bug in how node states were simulated by make.simmap
in versions of phytools<=0.2-26. between="" phytools="" 0.2-26="" and="" 0.2-36="" there="" was="" also="" a="" bug="" for="" asymmetric="" models="" of="" character="" change="" (e.g.,="" model="ARD"). Finally, between phytools 0.2-33 and phytools 0.2-47 there was an error in use of the conditional likelihoods for the root node, which caused the root node of the tree to be sampled incorrectly. All of these issues should be fixed in the present version.
Q="mcmc"
and Q
set to a fixed value were introduced to phytools >= 0.2-53. As of the present version of phytools, this method is still somewhat experimental & should be used with caution.
If tree
is an object of class "multiPhylo"
then nsim
stochastic maps are generated for each input tree.=0.2-26.>
brownie.lite
, brownieREML
, countSimmap
, describe.simmap
, evol.vcv
, plotSimmap
, read.simmap
, write.simmap