This function simulates a biogeographical history, given a Q transition matrix, a cladogenesis model giving the relative probability of different range inheritance scenarios, a phylogeny, and a 0-based index value deciding the starting state (which could be randomly generated according to a prior distribution of states).
simulate_biogeog_history(phy, Qmat, COO_probs_columnar, index_Qmat_0based_of_starting_state)
A (square, dense) Q transition matrix. Using a sparse matrix would require writing another function.
transition matrix, in COO-like form, as produced by
index value, between 0 and
simulated_states_by_node A numeric matrix, giving
the 0-based index of the state at each node and tip in
the simulated history. Getting a more detailed history
would require a version of stochastic mapping
(Huelsenbeck et al. (2003), Bollback
(2005), Bollback (2006)), but customized for the
nonreversible and cladogenic aspects of biogeographical
range evolution models.
Nicholas J. Matzke [email protected]
Loading required package: rexpokit Loading required package: cladoRcpp Loading required package: ape Loading required package: phylobase Attaching package: 'phylobase' The following object is masked from 'package:ape': edges
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.