tmBiSSE function

Generation of rooted binary trees under the BiSSE model

Generation of rooted binary trees under the BiSSE model

genBiSSETree - Generates a rooted binary tree in phylo

format with the given number of n leaves under the BiSSE model. In the BiSSE model all species have a state, either A or B, and depending on the state a speciation rate BIRTHRATES, an extinction rate DEATHRATES as well as a transition rate to the other state TRANSRATES.

Extinct species are removed from the tree, i.e., the generated tree contains only species living at the present.

genBiSSETree( n, BIRTHRATES = c(1, 1), DEATHRATES = c(0, 0), TRANSRATES, TRIES = 5, TIMEperTRY = 0.1 )

Arguments

  • n: Integer value that specifies the desired number of leaves, i.e., vertices with in-degree 1 and out-degree 0.

    Due to the restrictions of the phylo or multiphylo format, the number of leaves must be at least 2 since there must be at least one edge.

  • BIRTHRATES: Numeric vector (default = c(1,1)) which specifies the speciation rates in state A and B (vector with 2 values >=0, one value >0).

  • DEATHRATES: Numeric vector (default = c(0,0)) which specifies the extinction rates in state A and B (vector with 2 values >=0).

  • TRANSRATES: Numeric vector which specifies the transition rates from A to B and from B to A (vector with 2 values >0).

  • TRIES: Integer value (default = 5) that specifies the number of attempts to generate a tree with n leaves.

  • TIMEperTRY: Numeric value (default = 0.1) that specifies the maximum amount of time (in seconds) invested per try.

Returns

genBiSSETree A single tree of class phylo is returned.

Examples

if (requireNamespace("diversitree", quietly = TRUE)) { genBiSSETree(n = 5, BIRTHRATES = c(1,2), DEATHRATES = c(0,0), TRANSRATES = c(0.1,0.3)) }

References

  • This function uses the tree.bisse function of the diversitree package (R. G. FitzJohn. Diversitree: Comparative Phylogenetic Analyses of Diversification in R. Methods in Ecology and Evolution, 3(6):1084-1092, 2012).
  • W. P. Maddison, P. E. Midford, and S. P. Otto. Estimating a binary character’s effect on speciation and extinction. Systematic Biology, 56(5):701–710, 2007.
  • Maintainer: Sophie Kersting
  • License: GPL (>= 3)
  • Last published: 2024-08-16

Useful links