collesslikeI {treebalance} | R Documentation |
Calculation of the Colless-like indices for rooted trees
Description
This function calculates the Colless-like index for a given rooted
tree according to the chosen weight function
and dissimilarity
.
The Colless-like index
relative to
and
is the sum of the
-balance values
over all inner vertices of the tree. More precisely,
where is the
set of inner vertices of
. The
-balance value
of
with children
is computed as
with denoting the dissimilarity and
denoting the f.size.
The f.size of a tree
uses the function
, which maps any
integer to a non-negative real number, to build a weighted sum of
the out-degrees of all vertices in
. More precisely,
where is the set of all
vertices of
and
denotes the out-degree (i.e. the number of
children) of the vertex
. The
-functions that are already
implemented are
and
.
The dissimilarity of a vector
assigns
a non-negative value to the vector, is independent of the order of the vector
entries and equals zero if and only if
. In this
implementation the following dissimilarity functions are already built-in:
mean deviation from the median (
),
the sample variance (
) and the sample standard deviation (
).
collesslikeI
also allows the use of other functions for the weight function
and the dissimilarity
.
Special cases: For the function returns
and a warning.
For details on the family of Colless-like indices, see
also Chapter 16 in "Tree balance indices: a comprehensive survey" (https://doi.org/10.1007/978-3-031-39800-1_16).
Usage
collesslikeI(tree, f.size, dissim)
Arguments
tree |
A rooted binary tree in phylo format. |
f.size |
A character string specifying the function |
dissim |
A character string specifying the dissimilarity that shall be used. It can be one of the following: "mdm", "var", "sd" or the name of a function as a string. |
Value
collesslikeI
returns the Colless-like index of the given tree according to the chosen
function and dissimilarity.
Author(s)
Luise Kuehn, Sophie Kersting
References
A. Mir, L. Rotger, and F. Rossello. Sound Colless-like balance indices for multifurcating trees. PLOSONE, 13(9):e0203401, 2018. doi: 10.1371/journal.pone.0203401
Examples
tree <- ape::read.tree(text="((((,),),(,)),(((,),),(,)));")
collesslikeI(tree, f.size="exp", dissim="mdm")
collesslikeI(tree, f.size="exp", dissim="var")
collesslikeI(tree, f.size="ln", dissim="sd")
myfsize <- function(x) return(x+1)
mydissim <- function(x) return (var(x))
collesslikeI(tree, f.size="myfsize",dissim = "mydissim")