Calculate the Kendall-Colijn tree distance, a measure related to the path difference.

KendallColijn(tree1, tree2 = tree1)

KCVector(tree)

Arguments

tree1, tree2

Trees of class phylo, with leaves labelled identically, or lists of such trees to undergo pairwise comparison. Where implemented, tree2 = NULL will compute distances between each pair of trees in the list tree1 using a fast algorithm based on Day (1985).

tree

A tree of class phylo.

Value

KendallColijn() returns an array of numerics providing the distances between each pair of trees in tree1 and tree2, or splits1 and splits2.

Details

The Kendall-Colijn distance works by measuring, for each pair of leaves, the distance from the most recent common ancestor of those leaves and the root node. For a given tree, this produces a vector of values recording the distance-from-the-root of each most recent common ancestor of each pair of leaves.

Two trees are compared by taking the Euclidian distance between the respective vectors. This is calculated by taking the square root of the sum of the squares of the differences between the vectors.

This metric emphasizes the position of the root; the path difference instead measures the distance of the last common ancestor of each pair of leaves from the leaves themselves, i.e. the length of the path from one leaf to another.

Functions

  • KCVector: Creates a vector that characterises a rooted tree, as described in Kendall & Colijn (2016).

References

Kendall M, Colijn C (2016). “Mapping phylogenetic trees to reveal distinct patterns of evolution.” Molecular Biology and Evolution, 33(10), 2735--2743. doi: 10.1093/molbev/msw124 , https://doi.org/10.1093/molbev/msw124.

See also

treespace::treeDist is a more sophisticated, if more cumbersome, implementation that supports lambda > 0, i.e. use of edge lengths in tree comparison.

Other tree distances: JaccardRobinsonFoulds(), MASTSize(), MatchingSplitDistance(), NNIDist(), NyeSimilarity(), PathDist(), Robinson-Foulds, SPRDist(), TreeDistance()

Author

Martin R. Smith (martin.smith@durham.ac.uk)

Examples

KendallColijn(TreeTools::BalancedTree(8), TreeTools::PectinateTree(8))
#> [1] 11.48913
set.seed(0) KendallColijn(TreeTools::BalancedTree(8), lapply(rep(8, 3), ape::rtree))
#> [1] 9.591663 5.567764 9.949874
KendallColijn(lapply(rep(8, 4), ape::rtree))
#> [,1] [,2] [,3] [,4] #> [1,] 0.000000 7.280110 7.874008 4.795832 #> [2,] 7.280110 0.000000 8.185353 7.071068 #> [3,] 7.874008 8.185353 0.000000 7.681146 #> [4,] 4.795832 7.071068 7.681146 0.000000