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

Description Usage Arguments Value Author(s) References Examples

View source: R/sShapeI.R

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)=āˆ‘_{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.

Usage

1
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

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

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