stairs1 {treebalance}R Documentation

Calculation of the stairs1 value for rooted binary trees

Description

This function calculates the stairs1 value st1(T)st1(T) for a given rooted binary tree TT. It is a modified version of the Rogers J index and is defined as the fraction of inner vertices whose balance value is unequal to zero, more precisely

st1(T)=1n1uVin(T)(1I(nua=nub))st1(T)=\frac{1}{n-1}\cdot\sum_{u \in V_{in}(T)} (1-I(n_{u_a}=n_{u_b}))

in which Vin(T)V_{in}(T) denotes the set of all inner vertices of TT, and in which nuan_{u_a} and nubn_{u_b} denote the number of leaves in the two pending subtrees that are rooted at the direct descendants of uu. The stairs1 value is an imbalance index.

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

For details on the stairs1 value, see also Chapter 23 in "Tree balance indices: a comprehensive survey" (https://doi.org/10.1007/978-3-031-39800-1_23).

Usage

stairs1(tree)

Arguments

tree

A rooted binary tree in phylo format.

Value

stairs1 returns the stairs1 value of the given tree.

Author(s)

Sophie Kersting

References

M. M. Norstrom, M. C. Prosperi, R. R. Gray, A. C. Karlsson, and M. Salemi. PhyloTempo: A Set of R Scripts for Assessing and Visualizing Temporal Clustering in Genealogies Inferred from Serially Sampled Viral Sequences. Evolutionary Bioinformatics, 8:EBO.S9738, 2012. ISSN 1176-9343, 1176-9343. doi:10.4137/EBO.S9738.

Examples

tree <- ape::read.tree(text="((((,),),(,)),(((,),),(,)));")
stairs1(tree)


[Package treebalance version 1.2.0 Index]