weighL1dist: Calculation of weighted l1 distance index for rooted binary...

Description Usage Arguments Value Author(s) References Examples

View source: R/weighL1dist.R

Description

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

Dl1(T)= ∑ z*|f_n(z)-p_n(z)| over all possible sizes 2<=z<=n

in which n denotes the number of leaves of T, f_n(z) denotes the frequency of pending subtrees of size z in T and p_n(z) is the expected number of pending subtrees of size z under the Yule model, i.e. p_n(z)=1/(n-1) if z=n and otherwise n/(n-1)*2/(z*(z+1)).

For n=1 the function returns Dl1(T)=0.

Usage

1

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. François. 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

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

treebalance documentation built on Oct. 17, 2021, 5:06 p.m.