sShapeI {treebalance} | R Documentation |
Calculation of the s-shape statistic for rooted trees
Description
This function calculates the s-shape statistic for a given rooted
tree
. The tree must not necessarily be binary, however
only fulfils
the definition of an imbalance index on the space of binary trees.
is defined as
in
which denotes the set of inner vertices of
and
denotes the number of leaves
in the pending subtree that is rooted at
. An arbitrary logarithm base can be used
(for binary trees it is common to use base 2).
For the function returns
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)