genBiSSETree {poweRbal}R Documentation

Generation of rooted binary trees under the BiSSE model

Description

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.
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.

Usage

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.

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.

Value

genBiSSETree A single tree of class phylo is returned.

Author(s)

Sophie Kersting

References

Examples

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

[Package poweRbal version 0.0.0.3 Index]