IbasedI {treebalance} | R Documentation |
Calculation of the I-based indices for rooted trees
Description
This function calculates -based indices
for a given rooted
tree
. Note that the leaves of the tree may represent single species or
groups of more than one species. Thus, a vector is required that contains for
each leaf the number of species that it represents.
The tree may contain few polytomies, which are not allowed to concentrate in
a particular region of the tree (see p. 238 in Fusco and Cronk (1995)).
Let be a vertex of
that fulfills the following criteria: a)
The number of descendant (terminal) species of
is
(note that if each leaf represents only one species
is simply the
number of leaves in the pending subtree rooted at
), and
b)
has exactly two children.
Then, we can calculate the value as follows:
in which denotes the number of descendant (terminal) species
in the bigger one of the two pending subtrees rooted at
.
As the expected value of under the Yule model depends on
,
Purvis et al. (2002) suggested to take the corrected values
or
instead.
The value of
is defined as follows:
if
is odd and
if
is even.
The value of
is defined as follows:
where is the set of inner vertices of
that have precisely
two children and
, and
is a weight function with
if
is odd and
if
is even and
, and
if
is even and
.
The -based index of
can now be calculated using different methods.
Here, we only state the version for the
correction method, but the non-corrected
version or the
corrected version works analoguously.
1) root: The
index of
equals the
value of the root of
, i.e.
, provided that the root fulfills the two
criteria. Note that this method does not fulfil the definition of an (im)balance index.
2) median: The
index of
equals the median
value of all
vertices
that fulfill the two criteria.
3) total: The
index of
equals the summarised
values of all
vertices
that fulfill the two criteria.
4) mean: The
index of
equals the mean
value of all
vertices
that fulfill the two criteria.
5) quartile deviation: The
index of
equals the quartile
deviation (half the difference between third and first quartile) of the
values of all
vertices
that fulfill the two criteria.
For details on the family of I-based indices, see
also Chapter 17 in "Tree balance indices: a comprehensive survey" (https://doi.org/10.1007/978-3-031-39800-1_17).
Usage
IbasedI(
tree,
specnum = rep(1, length(tree$tip.label)),
method = "mean",
correction = "none",
logs = TRUE
)
Arguments
tree |
A rooted tree in phylo format (with possibly few polytomies). |
specnum |
A vector whose |
method |
A character string specifying the method that shall be used to
calculate |
correction |
A character string specifying the correction method that shall be applied to the I values. It can be one of the following: "none", "prime", "w". |
logs |
Boolean value, (default true), determines if the number of suitable nodes (i.e. nodes that fulfill the criteria) and polytomies in the tree should be printed. |
Value
IbasedI
returns an -based balance index of the given tree according to the chosen (correction and) method.
Author(s)
Luise Kuehn and Sophie Kersting
References
G. Fusco and Q. C. Cronk. A new method for evaluating the shape of large phylogenies. Journal of Theoretical Biology, 1995. doi: 10.1006/jtbi.1995.0136. URL https://doi.org/10.1006/jtbi.1995.0136.
A. Purvis, A. Katzourakis, and P.-M. Agapow. Evaluating Phylogenetic Tree Shape: Two Modifications to Fusco & Cronks Method. Journal of Theoretical Biology, 2002. doi: 10.1006/jtbi.2001.2443. URL https://doi.org/10.1006/jtbi.2001.2443.
Examples
tree <- ape::read.tree(text="(((((,),),),),);")
IbasedI(tree, method="mean")
IbasedI(tree, method="mean", correction="prime", specnum=c(1,1,2,1,1,1))