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 TT according to the chosen weight function ff and dissimilarity DD. The Colless-like index CL(T)CL(T) relative to DD and ff is the sum of the (D,f)(D,f)-balance values over all inner vertices of the tree. More precisely,

CL(T)=vVin(T)balD,f(v)CL(T)=\sum_{v\in V_{in}(T)} bal_{D,f}(v)

where Vin(T)V_{in}(T) is the set of inner vertices of TT. The (D,f)(D,f)-balance value of vv with children v1,...,vkv_1,...,v_k is computed as

balD,f(v)=D(fs(Tv1),...,fs(Tvk))bal_{D,f}(v)=D(fs(T_{v_1}),...,fs(T_{v_k}))

with DD denoting the dissimilarity and fsfs denoting the f.size.
The f.size fs(T)fs(T) of a tree TT uses the function ff, which maps any integer to a non-negative real number, to build a weighted sum of the out-degrees of all vertices in TT. More precisely,

fs(T)=vV(T)f(deg+(v))fs(T)=\sum_{v\in V(T)} f(deg+(v))

where V(T)V(T) is the set of all vertices of TT and deg+(v)deg+(v) denotes the out-degree (i.e. the number of children) of the vertex vv. The ff-functions that are already implemented are f(x)=exf(x)=e^x and f(x)=ln(x+e)f(x)=ln(x+e).
The dissimilarity D(x1,...,xk)D(x_1,...,x_k) of a vector x1,...,xkx_1,...,x_k assigns a non-negative value to the vector, is independent of the order of the vector entries and equals zero if and only if x1=...=xkx_1=...=x_k. In this implementation the following dissimilarity functions are already built-in: mean deviation from the median (mdmmdm), the sample variance (varvar) and the sample standard deviation (sdsd).
collesslikeI also allows the use of other functions for the weight function ff and the dissimilarity DD.

Special cases: For n=1n=1 the function returns CL(T)=0CL(T)=0 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 ff that shall be used to compute the f.size. It can be one of the following: "exp", "ln" or the name of a function as a string.

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")


[Package treebalance version 1.2.0 Index]