estimate_node_heights: Calculate expected time to branching point of a species tree

Description Usage Arguments Details Value References Examples

View source: R/estimate_node_heights.R

Description

Calculates the expected time to branching point of a species tree for a birth-death simulation given a speciation and extinction rate and a number of leaves, and a branching point.

Usage

1
2
3
estimate_node_heights(lambda, mu, n, k = 1)

node_heights(lambda, mu, n, k = 1)

Arguments

lambda

speciation rate

mu

extinction rate

n

number of tips on tree

k

branching point (k = 1 is the root and is the default)

Details

By default this branching point is 1 which corresponds to the root, k = 2 corresponds to the first branching point after the root, k = 3 the second, and so on. For more details see Gernhard 2008.

Value

The expected branching time

References

Gernhard, T. (2008). The conditioned reconstructed process. Journal of theoretical biology, 253(4), 769-778.

Examples

1
2
3
4
5
6
spec_rate <- 1.0
ext_rate <- 0.5
nt <- 10
node_heights(lambda = spec_rate, mu = ext_rate, n = nt)

node_heights(lambda = spec_rate, mu = ext_rate, n = nt, k = 2)

treeducken documentation built on March 3, 2021, 1:11 a.m.