stairs2: Calculation of the stairs2 value for rooted binary trees

Description Usage Arguments Value Author(s) References Examples

View source: R/stairs2.R

Description

This function calculates the stairs2 value st2(T) for a given rooted binary tree T. It is defined as the mean ratio between the leaf numbers of the smaller and larger pending subtree over all inner vertices, more precisely

st2(T)=1/(n-1)*∑_{u in V_in(T)} (n_ua/n_ub)

in which V_in(T) denotes the set of all inner vertices of T, and in which n_ua >= n_ub denote the number of leaves in the two pending subtrees that are rooted at the direct descendants of u. The stairs2 value is an imbalance index.

Special cases: For n=1, the function returns st2(T)=0 and a warning.

Usage

1
stairs2(tree)

Arguments

tree

A rooted binary tree in phylo format.

Value

stairs2 returns the stairs2 value of the given tree.

Author(s)

Sophie Kersting

References

C. Colijn and J. Gardy. Phylogenetic tree shapes resolve disease transmission patterns. Evolution, Medicine, and Public Health, 2014(1):96-108, 2014. ISSN 2050-6201. doi: 10.1093/emph/eou018.

Examples

1
2
tree <- ape::read.tree(text="((((,),),(,)),(((,),),(,)));")
stairs2(tree)

treebalance documentation built on Oct. 17, 2021, 5:06 p.m.