weighL1dist {treebalance}R Documentation

Calculation of weighted l1 distance index for rooted binary trees

Description

This function calculates the weighted l1 distance index Dl1(T)D_{l1}(T) for a given rooted binary tree TT. Dl1(T)D_{l1}(T) is defined as

Dl1(T)=z=2nzfn(z)pn(z)D_{l1}(T)=\sum_{z=2}^n z \cdot |f_n(z)-p_n(z)|

in which nn denotes the number of leaves of TT, fn(z)f_n(z) denotes the frequency of pending subtrees of size zz in TT and pn(z)p_n(z) is the expected number of pending subtrees of size zz under the Yule model, i.e. pn(z)=1n1p_n(z)=\frac{1}{n-1} if z=nz=n and otherwise nn12z(z+1)\frac{n}{n-1}\cdot\frac{2}{z\cdot(z+1)}.

For n=1n=1 the function returns Dl1(T)=0D_{l1}(T)=0.

For details on the weighted l1 distance index, see also Chapter 24 in "Tree balance indices: a comprehensive survey" (https://doi.org/10.1007/978-3-031-39800-1_24).

Usage

weighL1dist(tree)

Arguments

tree

A rooted binary tree in phylo format.

Value

weighL1distI returns the weighted l1 distance index of the given tree.

Author(s)

Sophie Kersting

References

M. G. Blum and O. Francois. On statistical tests of phylogenetic tree imbalance: The Sackin and other indices revisited. Mathematical Biosciences, 195(2):141-153, 2005. doi: 10.1016/j.mbs.2005.03.003.

Examples

tree <- ape::read.tree(text="((((,),),(,)),(((,),),(,)));")
weighL1dist(tree)


[Package treebalance version 1.2.0 Index]