sShapeI: Calculation of the s-shape statistic for rooted trees

View source: R/sShapeI.R

sShapeIR Documentation

Calculation of the s-shape statistic for rooted trees

Description

This function calculates the s-shape statistic sShape(T) for a given rooted tree T. The tree must not necessarily be binary, however sShape only fulfils the definition of an imbalance index on the space of binary trees. sShape(T) is defined as

sShape(T)=\sum_{u\in V_{in}(T)} log(n_u-1)

in which V_{in}(T) denotes the set of inner vertices of T and n_u denotes the number of leaves in the pending subtree that is rooted at u. An arbitrary logarithm base can be used (for binary trees it is common to use base 2).

For n=1 the function returns sShape(T)=0 and a warning.

For details on the s-shape statistic, see also Chapter 9 in "Tree balance indices: a comprehensive survey" (https://doi.org/10.1007/978-3-031-39800-1_9).

Usage

sShapeI(tree, logbase = 2)

Arguments

tree

A rooted tree in phylo format.

logbase

The logarithm base that shall be used.

Value

sShapeI returns the s-shape statistic of the given tree.

Author(s)

Luise Kuehn

References

M.G. Blum and O. Francois. Which random processes describe the tree of life? a large-scale study of phylogenetic tree imbalance. Systematic Biology, 2006.

Examples

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


treebalance documentation built on May 29, 2024, 1:15 a.m.