totCophI | R Documentation |
This function calculates the total cophenetic index TCI(T)
of a given
rooted tree T
. The tree must not necessarily be binary. TCI(T)
is defined as
TCI(T)=\sum_{1\leq i<j\leq n} \delta(lca(i,j))=\sum_{u\in V_{in}(T)\setminus\{\rho\}} binom(n_u,2)
in which \delta(lca(i,j))
denotes the depth of the lowest
common ancestor of the two leaves i
and j
and V_{in}(T)\setminus\{\rho\}
denotes the set of all inner vertices exept the root and n_u
denotes the
number of descendant leaves of u
. The second formula is useful for efficient
computation of TCI(T)
. The total cophenetic index is an imbalance index.
For n=1
the function returns TCI(T)=0
.
For details on the total cophenetic index, see
also Chapter 8 in "Tree balance indices: a comprehensive survey" (https://doi.org/10.1007/978-3-031-39800-1_8).
totCophI(tree)
tree |
A rooted tree in phylo format. |
totCophI
returns the total cophenetic index of the given tree.
Sophie Kersting
A. Mir, F. Rossello, and L. Rotger. A new balance index for phylogenetic trees. Mathematical Bio-sciences, 241(1):125-136, 2013. doi: 10.1016/j.mbs.2012.10.005.
tree <- ape::read.tree(text="((((,),),(,)),(((,),),(,)));")
totCophI(tree)
tree <- ape::read.tree(text="((,),((((,),),),(,)));")
totCophI(tree)
tree <- ape::read.tree(text="((,,,),(,,));")
totCophI(tree)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.