Skip to main content
Systematic Biology logoLink to Systematic Biology
. 2011 Apr 6;60(4):528–540. doi: 10.1093/sysbio/syr021

Bayes Estimators for Phylogenetic Reconstruction

P M Huggins 1,2, W Li 3, D Haws 2, T Friedrich 2, J Liu 3, R Yoshida 2,*
PMCID: PMC3114872  PMID: 21471560

Abstract

Tree reconstruction methods are often judged by their accuracy, measured by how close they get to the true tree. Yet, most reconstruction methods like maximum likelihood (ML) do not explicitly maximize this accuracy. To address this problem, we propose a Bayesian solution. Given tree samples, we propose finding the tree estimate that is closest on average to the samples. This “median” tree is known as the Bayes estimator (BE). The BE literally maximizes posterior expected accuracy, measured in terms of closeness (distance) to the true tree. We discuss a unified framework of BE trees, focusing especially on tree distances that are expressible as squared euclidean distances. Notable examples include Robinson–Foulds (RF) distance, quartet distance, and squared path difference. Using both simulated and real data, we show that BEs can be estimated in practice by hill-climbing. In our simulation, we find that BEs tend to be closer to the true tree, compared with ML and neighbor joining. In particular, the BE under squared path difference tends to perform well in terms of both path difference and RF distances.

Keywords: Bayes estimator, consensus tree, path difference metric, phylogenetic inference


When a large phylogeny is reconstructed from sequence data, it is typically expected that the reconstructed tree is at least slightly wrong, that is, slightly different than the true tree. One common cause of reconstruction error is short sequence length. To help cope with this issue, bootstrapping and Bayesian sampling methods provide a collection of possible trees instead of a single-tree estimate. Using bootstrapping or Bayesian sampling, one common practice is to identify highly supported tree features (e.g., splits) that occur in almost all the tree samples. Highly supported features are regarded as likely features of the true tree.

Similarly, in simulation studies, it is common to judge reconstruction methods based on how close they get to the true tree (Desper and Gascuel 2004). Closeness to the true tree can be measured in many different ways. One popular measure of closeness is the Robinson–Foulds (RF) distance (also known as symmetric difference).

These customary practices reflect a common view that when reconstruction errors are likely, a good reconstruction method ought to at least find a tree that is close to the true tree. For example, if multiple trees have high likelihood, then a good tree estimate should be an “accurate representative” of the high likelihood trees. Yet, reconstruction methods like maximum likelihood (ML) are not directly designed to achieve this goal. This leads us to ask whether reconstruction accuracy (i.e., closeness to the true tree) can be improved by attempting to directly optimize accuracy instead of likelihood.

Even though the true tree is unknown, we can still optimize reconstruction accuracy using a Bayesian approach. In the Bayesian view, the true tree is a random variable T distributed according to the posterior distribution P(T|D), where D is input data such as sequence data. Given a notion of distance between trees, we can aim to find a tree estimate that minimizes the expected distance to T. This “median tree” is called a Bayes estimator (BE). The BE depends on how distance between trees is defined.

Many popular distances between trees can be easily expressed as a squared euclidean distance (“sum of squares”), after embedding trees in an appropriately chosen vector space. Important examples include RF distance (symmetric difference), quartet distance, and the squared path difference. In this paper, we focus on squared euclidean distances.

In statistical decision theory, BEs under squared euclidean distance are well understood and have nice properties. For example, under a squared euclidean distance, the BE minimizes the distance to the mean of the posterior. This gives the following result in Holder et al. (2008). The majority-rule consensus tree is the BE, if closeness between trees is defined by RF distance. We also derive a closely related result for quartet distance. Under quartet distance, the BE tree is equivalent to a weighted quartet puzzling problem.

In general, computing BEs is at least as hard as computing ML trees. Hill-climbing techniques are popular and effective heuristics for hard tree optimization problems such as ML. Thus, we propose hill-climbing to compute BE trees as well.

We provide a simulation study of BEs using the path difference metric. We use hill-climbing with nearest neighbor interchange (NNI) moves to estimate BEs. We observe that hill-climbing is fast in practice, after the preprocessing step of sampling the posterior on trees. More importantly, we observe that BE trees are more accurate on average compared to ML and neighbor joining (NJ). These results comprise an encouraging pilot study of BEs. We conclude by discussing improvements and directions for future work developing BEs for phylogeny.

BES AND SQUARED EUCLIDEAN DISTANCE

Throughout we assume basic terminology of Bayesian statistics. A recent treatment can be found in Bolstad (2007).

Let D denote a collection of homologous sequences from n species. Many evolutionary models exist that express P(D|T,θ) in terms of an underlying phylogenetic tree T on the n species and evolutionary rate parameters θ. Given such a model, and observed sequence data D, Bayesian Markov chain Monte Carlo (MCMC) sampling can be used to sample (approximately) from P(T|D)∝P(T)P(D|T).

The distribution P(T|D) can be used for phylogenetic reconstruction. Given a measure of dissimilarity (or distance) d(T,T′) between phylogenetic trees of n taxa, the (posterior) expected loss associated with a tree T′ is 𝔼d(T,T′), where the expectation is taken over T, distributed as P(T|D). We write ρ(T′) for the expected loss. The BE T* minimizes the expected loss:

graphic file with name sysbiosyr021fx1_ht.jpg

In other words, regarding the true tree T as a random variable distributed as P(T|D), the BE is the tree T* that is closest to T on average.

Traditional tree estimators like ML or maximum a posteriori (MAP) choose the tree with the highest likelihood or probability given the data. Intuitively, this is similar to the BE minimizing expected distance to the true tree. But the concepts are generally different (see Holder et al. 2008, for a nice discussion). A BE attempts to give a good representation of the true tree, even if some reconstruction errors are present. In contrast, traditional reconstruction techniques such as ML/MAP attempt to find a tree that is most likely to be 100% accurate. Thus, the BE is designed to outperform ML/MAP (in terms of distance to the true tree), in situations where all trees have very low posterior probability.

BEs are a common tool in statistical optimization and decision theory (Berger 1985). Given a finite sample T1,…,TN from P(T|D), the empirical expected loss is ρ^(T′)=1N∑i=1Nd(T′,Ti), and the empirical BE is the tree that minimizes the empirical expected loss. In this paper, we will focus on empirical BEs for a given sample and so we will simply say “BE” when we mean the empirical BE.

Squared Euclidean Distances between Trees

Let 𝒯n be the space of trees of n taxa. A distance d(·,·) on trees is squared euclidean if there is a function v:𝒯n→ℝm for some m, such that

graphic file with name sysbiosyr021fx2_ht.jpg

Here, ‖·‖ denotes the euclidean length of a vector.

Intuivitely, if d(·,·) is a squared euclidean distance, then we can regard trees as points in space and d(·,·) is the squared distance between points (e.g., computed by the Pythagorean theorem). The mapping v() is called a vector space embedding.

Many popular distances between trees are squared euclidean distances. Below we list several examples, all of which were studied in Steel and Penny (1993). For each distance, we illustrate the vector space embedding and the distance using the two trees T1 and T2 shown in Figure 3 (no branch lengths) and Figure 2 (branch lengths). In newick format, the tree topologies are T1: = ((A,B),C,(D,E)) and T2: = ((A,B),E,(D,C)).

FIGURE 3.

FIGURE 3.

Normalized path difference Inline graphic for tree estimates T* computed by various reconstruction methods, for 1000 simulated trees Ttrue with n = 40 taxa. Here, NJ (N) is the NJ tree constructed via neighbor in PHYLIP package, ML (L) is the PHYML tree, and Bayes (B) is the BE tree, estimated from MrBayes samples.

FIGURE 2.

FIGURE 2.

Same two trees in Figure 1 with branch lengths assigned, T1 (left) and T2 (right).

RF distance.—

Let S(T) denote the set of splits induced by a tree T. The (normalized) RF distance (Robinson and Foulds 1981) dRF(T,T′) is half the size of the symmetric difference of splits, (S(T) − S(T′))∪(S(T′) − S(T)). The RF distance can also be realized as the squared euclidean distance

graphic file with name sysbiosyr021fx4_ht.jpg

where vRF:𝒯n→ℝ2n − 1 − 1 maps tree T to the 0/1 vector vRF(T) whose nonzero entries correspond to splits in T. For example, for the trees T1 and T2 in Figure 3, we have

graphic file with name sysbiosyr021fx5_ht.jpg

and

graphic file with name sysbiosyr021fx6_ht.jpg

Here, the coordinates of vRF(T1) and vRF(T2) are given by

graphic file with name sysbiosyr021fx7_ht.jpg

where, for example, BD corresponds to the split BD|ACE. For example, the 12th coordinate corresponding to the split DE|ABC in the vector vRF(T1) is 1, but it is 0 in vRF(T1) because T1 has the split DE|ABC but not T2. dRF(T1,T2) is calculated by counting the number of splits among the two trees that are in one tree and not in the other and then dividing by 2. With the example above, there are two splits among T1 and T2, that are in one tree and not in the other and so the distance is 2/2 = 1′′.

Quartet distance.—

Let Q(T) denote the set of quartets induced by a tree T. The quartet distance (Estabrook et al. 1985) dQ(T,T′) is half the size of the symmetric difference of quartets, (Q(T) − Q(T′))∪(Q(T′) − Q(T)) Analogous to the RF distance, dQ can be realized as a squared euclidean distance,

graphic file with name sysbiosyr021fx8_ht.jpg

where Inline graphic maps tree T to the 0/1 vector vQ(T) whose nonzero entries correspond to quartets in T. For example, for the trees T1 and T2 in Figure 3, we have

graphic file with name sysbiosyr021fx10_ht.jpg

and

graphic file with name sysbiosyr021fx11_ht.jpg

Here, the coordinates of vQ(T1) and vQ(T2) are given by the following quartets:

graphic file with name sysbiosyr021fx12_ht.jpg

The first coordinates corresponding to the quartet AB|CD, for example, in vQ(T1) and vQ(T2) are 1 because T1 and T2 have the quartet AB|CD, and the 4th coordinate corresponding to the quartet BC|DE is 1 in vQ(T1) but it is 0 in vQ(T2) because T1 has the quartet BC|DE but not T2. dQ(T1,T2) is calculated by counting the number of quartets among the two trees, that are in one tree and not in the other and then dividing by 2. With the example above, there are four splits among T1 and T2, that are on one tree and not on the other and so the distance is 4/2 = 2.

Squared dissimilarity map distance.—

For T∈𝒯n, let Inline graphic be the matrix of pairwise distances between leaves in T. The squared dissimilarity map distance is defined as dD(T′,T) = ‖DT − DT′‖2. The dissimilarity map distance is perhaps one of the oldest studied; see, for example, Buneman (1971). For example, for the trees T1 and T2 in Figure 2, we have

graphic file with name sysbiosyr021fx14_ht.jpg

and

graphic file with name sysbiosyr021fx15_ht.jpg

Here, the coordinates of DT1 and DT2 are given by

graphic file with name sysbiosyr021fx16_ht.jpg

where Di,j is the sum of branch lengths of the path from leaf i to j.

Squared path difference.—

The distances dRF(T,T′) and dQ(T,T′) are topological distances, that is, they only depend on the topologies of T,T′ and not edge lengths. The dissimilarity map distance does depend on edge lengths, but it has a natural topological analog called the path difference metric. The squared path difference is

graphic file with name sysbiosyr021fx17_ht.jpg

where Inline graphic is the integer vector whose (i,j)th entry counts the number of edges between leaves i and j in T. Path difference was studied in Steel and Penny (1993). Note that in our notation, we have squared the norm, whereas Steel and Penny (1993) defined dp(T′,T) = ‖vp(T) − vp(T′)‖.

For example, for the trees T1 and T2 in Figure 3, we have

graphic file with name sysbiosyr021fx19_ht.jpg

and

graphic file with name sysbiosyr021fx20_ht.jpg

Here, the coordinates of vp(T1) and vp(T2) are given by

graphic file with name sysbiosyr021fx21_ht.jpg

where vi,j is the number of edges between leaf i and j.

The above examples highlight the fact that many combinatorial distances can be interpreted as squared euclidean distances. Under a squared euclidean distance, the BE is the projection of the mean onto the nearest tree. More specifically, if d(T,T′) = ‖v(T) − v(T′)‖2 is a squared euclidean distance, then a bias–variance decomposition gives

graphic file with name sysbiosyr021fx22_ht.jpg

where μ = 𝔼[v(T)] and Var = t r( c o v(v(T))) does not depend on T′. (See the appendix for details.) Thus, we can redefine

graphic file with name sysbiosyr021fx23_ht.jpg (1)

In our view, projecting a point (e.g., input dissimilarity map) to a nearby tree is a geometric analog of a BE. Indeed, distance-based tree reconstruction methods can be loosely regarded as “projections” of an input dissimilarity map Inline graphic onto a tree metric DT = D + ε, where ε is “small” according to some norm. The geometry of distance-based tree reconstruction methods has been studied before, see Mihaescu et al. (2007), Eickmeyer et al. (2008), and Eickmeyer and Yoshida (2008).

Computing BEs

Because the number of tree topologies of n taxa grows exponentially in n, computing the BE T* under a general distance function can be computationally hard. However, hill-climbing techniques such as those used in ML methods (Guindon and Gascuel 2003) often work quite well in practice for tree reconstruction. Hill-climbing techniques can similarly be used to minimize empirical expected loss. We propose hill-climbing as a general technique for BEs.

Hill-climbing requires computing the empirical expected loss ρ^(T) at each step. Computing the empirical expected loss ρ^(T) at each step can be sped up considerably for euclidean square distances because the simpler definition ρ^(T)=d(T,μ^) in Equation 1 can be used.

RELATION BETWEEN BES AND EXISTING RECONSTRUCTION METHODS

Consensus Trees

Using our framework, we review the example of RF distance and consensus trees, which was studied by Berry and Gascuel (1996) and Holder et al. (2008). Under RF distance, the BE is obtained by projecting the vector of split frequencies μRF = 𝔼[vRF(T)] onto the nearest tree, that is, the nearest 0/1 vector of the form vRF(T*)∈{vRF(T′)}T′⊂{0,1}2n − 1 − 1. If we project μRF onto the nearest 0/1 vector v*∈{0,1}2n − 1 − 1, then we see v* is obtained by rounding all entries in μRF to the nearest integer 0 or 1. In other words, we can set v* = vRF(T*), where T* is the majority-rule consensus tree. Thus, the majority-rule consensus tree is a BE for RF distance.

More generally, Holder et al. (2008) have shown that for any α≥12, the (100×α) − % majority-rule tree is a BE for a suitable distance. Interestingly, the type of distance they employ is a generalized version of RF, assigning separate weights to the two sides of the symmetric difference in order to make a sensitivity/specificy tradeoff.

Quartet puzzling

Under the quartet distance dQ(T,T′) = ‖vQ(T) − vQ(T′)‖2, the BE is the tree T* that minimizes ‖vQ(T) − μQ‖2, where μQ = 𝔼vQ(T) is the vector of posterior quartet frequencies. Because Inline graphic for all trees of n taxa, we have

graphic file with name sysbiosyr021fx26_ht.jpg

and so the BE T* can be equivalently defined as T* = argmaxTμQ·vQ(T). Maximizing μQ·vQ(T) is a weighted quartet puzzling problem; Given a set of weights μQ on quartets, find a compatible set of quartets of maximal weight. If all quartet weights are 0/1, then we obtain the traditional quartet puzzling problem (Strimmer and von Haeseler 1996).

Analogous to split frequencies and the consensus tree, we can use a sample of trees to estimate quartet frequencies, and then apply weighted quartet puzzling to find the BE tree. In general though, quartet puzzling (and hence weighted quartet puzzling) is non-deterministic polynomial-time hard (NP-hard) (Steel 1992). However, there has been considerable progress toward solving large instances (see, e.g., Erdos et al. 1997, Snir and Rao 2010). In our case, the weights μQ have special structure because they are realizable by a collection of trees, and this might make the weighted quartet puzzling we are considering here easier.

SIMULATION STUDY: METHODS

Choice of Distance

For studying BEs, a natural choice to measure distance between trees is RF distance. But then the BE is the consensus tree, which has been extensively studied, and is easy to compute from samples. We thus sought out other important distances besides RF.

Dissimilarity map distance is one of the oldest distances in phylogenetics and lies at the foundation of distance-based reconstruction methods. Thus, dissimilarity map and related distances are a natural choice for case study of BEs. We specifically chose the (squared) path difference metric. The path difference metric ‖vp(T) − vp(T′)‖ is precisely the dissimilarity map distance ‖DT − DT′‖, if all edge lengths in T,T′ are redefined to be 1. Setting all edge lengths to 1 prevents deemphasis of the shorter (presumably uncertain) edges. Intuitively, this emphasizes topological accuracy in the BE.

Path difference has several desirable properties. For example, path difference can be computed quickly, and the associated vector space embedding has low dimension Inline graphic for trees of n taxa. In Steel and Penny (1993), path difference was studied under various tree distributions, and found to be more broadly distributed across a large range of values, compared to quartet or RF distance. Finally, the BE under path difference has a natural phylogenetic interpretation. The BE is the most accurate representative of the number of speciation events separating each pair of taxa.

Thus, we chose the squared path difference as a case study. We think quartet distance would also be interesting, but believe that a study of BEs under quartet distance should include quartet puzzling methods, given the close connections outlined in the quartet puzzling section. We have therefore deferred study of quartet distance.

Simulated Data

For simulated data, we used the first 1000 examples from the data set presented in Guindon and Gascuel (2003). We briefly review the details of the data set. Trees of 40 taxa were generated according to a Markov process. For each generated tree, 40 homologous sequences (no insertions and deletions) of length 500 were generated, under the Kimura two-parameter (K2P) model (Kimura 1980), with a transition/transversion ratio of 2.0. Specifically, the Seq-Gen program (Rambaut and Grassly 1997) was used to generate the sequences. The data is available from the web site http://www.atgc-montpellier.fr/phyml/datasets.php.

Reconstruction Methods

For each set of homologous sequences D in the simulated data, we used the software MrBayes (Huelsenbeck and Ronquist 2001) to obtain 15,000 samples from the posterior distribution P(T|D). Specifically, we ran MrBayes under the K2P model, discarded the initial 25% of samples as a burn-in, used a 50 generation sample rate and ran for 1,000,000 generations in total. MrBayes suggests running MCMC chains until the standard deviation of the chains' split frequencies is less than 0.01. In our simulation, 996 out of 1000 experiments fell below the 0.01 threshold (the median was 0.0037).

We computed an ML tree estimate for each data set, using the hill-climbing software PHYML (Guindon and Gascuel 2003) using the K2P model and default parameters. We also computed an NJ tree using the software PHYLIP (Felsenstein 1989), using pairwise distances computed by PHYLIP under the K2P model.

We then used our in-house software to minimize the expected path difference squared euclidean distance by hill-climbing. We performed hill-climbing using NNI moves and restricted the search to fully resolved trees. For starting trees, we used the NJ tree, the ML tree, and five samples from P(T|D) (NJ and ML trees were computed as described above). We also used the MAP tree.

See the appendix for more details about our hill-climbing implementation. The java source code is available at http://cophylogeny.net/research.php.

Comparing Objective Functions for Tree Reconstruction

In our distance-based framework, the canonical measure of reconstruction accuracy is the path difference dp(T*,Ttrue) between the true tree Ttrue and the estimated tree T*. One obvious question is: How good of a guide is the expected loss (and other measures, for example, posterior probability), for predicting distance to the true tree? The relationships among objective functions are particularly important for nearly optimal trees.

We explored this question using the simulated data. For each of the 1000 data sets, we extracted the distinct topologies from the 15,000 MrBayes samples Ti, i = 1,…,15,000, and then computed the following three scores for each topology T. 1) The observed frequency of topology T in MrBayes samples, 2) The empirical expected loss: ρ^p(T)=‖vp(T)−115,000∑jvp(Tj)‖2, and 3) The actual distance to the true tree: dp(T,Ttrue) = ‖vp(T) − vp(Ttrue)‖2.

For each data set, we restricted our attention to the 25 most frequent tree topologies. The number of samples 15,000 was large enough so that the frequencies of the 25 most probable tree topologies could be estimated fairly well (e.g., in most cases, the top 25 topologies all had frequency ≥ 50). For the 25 most probable topologies, we computed the correlations (Kendall's tau) among the three scores and recorded the results in Table 1. For two scores, the Kendall's tau τ has a natural interpretation. Namely, (1 + τ)/2 is the proportion of tree pairs that receive the same ordering under both scores (assuming ties are broken randomly).

TABLE 1.

Above: The Kendall's tau correlations among scores Below: The implied concordance percentages among scores

P(Ti) ρ^p(Ti) dp(Ti,Ttrue)
P(Ti) ⋅  0.352 0.148
ρ^p(Ti) ⋅  0.270d(Ti,Ttrue)
P(Ti) ρ^p(Ti) dp(Ti,Ttrue)
P(Ti) ⋅  67.6% 57.4%
ρ^p(Ti) ⋅  63.5%d(Ti,Ttrue)

Note: For each of the 1000 data sets, we extracted the 25 most frequent tree topologies from the MrBayes samples and computed three scores for the 25 topologies. The three scores we investigated are 1) The observed frequency of the tree topology in MrBayes samples, 2) The empirical expected distance ρ^p(Ti)=kvp(Ti)−115000Pjvp(Tj)k2, and 3) The actual distance dp(Ti,Ttrue) = kvp(Ti) − vp(Ttrue)k2. For each pair of scores, we computed the Kendall's tau correlation τ. We also list the values (1 + τ)/2, which is the percentage of topology pairs whose orderings are concordant under both scores (assuming ties are broken randomly).

SIMULATION STUDY: RESULTS

As the Kendall's tau correlations in Table 1 show, the expected loss ρ^p is better than posterior probability, as a predictor of distance to the true tree. This suggests that for hill-climbing optimization, the BE is better equipped than MAP to get closer to the true tree.

The Kendall's tau correlations in Table 1 are fairly low, suggesting that distance to the true tree is difficult to estimate. To some extent this is inevitable because the true tree is random (i.e., a random sample from P(T|D)). Also, we restricted to the top 25 topologies, which could all be similar and near-optimal, and hence difficult to compare.

As described in (Simulation Study: Methods), for each simulated data set we computed NJ, ML, and MAP trees. We then performed NNI-based hill-climbing to optimize ρ^p using NJ/ML/MAP as starting trees as well as starts chosen randomly from MrBayes samples. We estimated the BE tree by taking the best of the five random starts.

Following Guindon and Gascuel (2003), we plotted the inaccuracy (normalized path difference to the true tree) of the NJ, ML, BE majority-rule consensus, and MAP trees in Figure 1. Note that we used data sets introduced with phyML in Guindon and Gascuel (2003). We used this data because phyML is a popular ML method, which is very similar to our hill-climbing (they NNI hill climb the likelihood, whereas we NNI hill climb expected loss). In our study, we use phyML to compute ML trees, and we have sought the fairest possible comparison between phyML and our BE software. In the plot, inaccuracy is plotted against the maximum unadjusted pairwise divergence in the sequence data. The unadjusted pairwise divergence between two sequences is the proportion of sites where both sequences differ.

FIGURE 1.

FIGURE 1.

Two trees of five taxa with different topologies, T1 (left) and T2 (right).

We also give an analogous plot in Figure 4, plotting the empirical expected loss of various tree estimators. Note that the true tree might not be the global optimum of the expected loss. Thus, we included the true tree in the plot as well.

FIGURE 4.

FIGURE 4.

Normalized empirical expected distance to the true tree, Inline graphic for tree estimates T* computed by various reconstruction methods, for 1000 simulated trees Ttrue with n = 40 taxa. For each data set, T1,…,TN are the N = 15,000 posterior tree samples obtained by MrBayes. In the plot, True (T) denotes the true tree, NJ (N) is the NJ tree constructed via neighbor in PHYLIP package, ML (L) is the PHYML tree, and Bayes (B) is the BE tree, estimated from MrBayes samples.

As Figure 1 indicates, ML and BE trees achieve the highest accuracy, outperforming both NJ and the majority-rule consensus tree. The BE shows a small improvement over MAP (not shown), which in turn improves upon the phyML tree. As one might expect, the consensus tree performs poorly because it underestimates the number of splits as well as the number of edges between taxa.

In addition, in Figure 5, we plotted (normalized) RF distance to the true tree for all the tree estimators. As expected, the majority-rule consensus tree minimizes RF distance to the true tree. Interestingly, the accuracy of our BE is almost identical to ML and MAP in terms of RF distance. This contrasts with the poor performance of the consensus tree in terms of path difference.

FIGURE 5.

FIGURE 5.

Normalized RF distance to the true tree, ‖vRF(T*) − vRF(Ttrue)‖2/(2n − 6) for tree estimates T* computed by various reconstruction methods, for 1000 simulated trees Ttrue with n = 40 taxa. Here, NJ (N) is the NJ tree constructed via neighbor in PHYLIP package, ML (L) is the PHYML tree, and Bayes (B) is the BE tree, estimated from MrBayes samples.

All curves in the figures are without error bars; see our Supplementary material (available from http://www.sysbio.oxfordjournals.org/) for analogous figures with error bars. However, errors in the plotted lines are certainly correlated between different tree reconstruction methods. Thus, to make more sensitive comparison for BE versus MAP and BE versus phyML, we also plotted fitted curves for (BE–MAP) and (BE–ML), along with confidence bands representing two standard deviations. See Figures 6 and 7 as well as Figures 8 and 9. Almost all data points for path difference (and some for RF) show BE outperforming ML by a margin of two standard deviations. The majority of data points show BE outperforming ML under both distances. And ML never outperforms BE by two standard deviations.

FIGURE 6.

FIGURE 6.

Normalized path difference to the true tree, for both the ML tree and the BE tree. Here, the difference (BE–ML) is plotted. For convenience, the line y = 0 is also plotted. At positive values, ML is closer to the true tree, and at negative values, BE is closer. The dashed lines are + / − 2 estimated standard deviations.

FIGURE 7.

FIGURE 7.

Normalized RF distance to the true tree, for both the ML tree and (path difference) the BE tree. Here, the difference (BE–ML) is plotted. For convenience, the line y = 0 is also plotted. At positive values, ML is closer to the true tree, and at negative values, BE is closer. The dashed lines are + / − 2 estimated standard deviations.

FIGURE 8.

FIGURE 8.

Normalized path difference to the true tree, for both the MAP tree and (path difference) the BE tree. Here, the difference (BE–MAP) is plotted. For convenience, the line y = 0 is also plotted. At positive values, MAP is closer to the true tree, and at negative values, BE is closer. The dashed lines are + / − 2 estimated standard deviations.

FIGURE 9.

FIGURE 9.

Normalized RF distance to the true tree, for both the MAP tree and (path difference) the BE tree. Here, the difference (BE–MAP) is plotted. For convenience, the line y = 0 is also plotted. At positive values, MAP is closer to the true tree, and at negative values, BE is closer. The dashed lines are + / − 2 estimated standard deviations.

We also asked whether the BE tree tended to resolve the consensus tree. We found that on 83% of examples, the BE indeed resolved the consensus tree. Moreover, on 98% of examples, the BE was “close” to a resolution of the consensus tree (within RF distance of 0,1, or 2).

Tables 2 and 3 summarize the results of our NNI-based hill-climbing when ML/NJ/MAP trees are used as the starting tree. Note that the ML tree (computed by phyML) was obtained by NNI hill-climbing optimizing likelihood, and then our hill-climbing performed additional NNI moves to improve the expected loss.

TABLE 2.

Assessing local improvability of various tree estimators

Initial tree Hill climb improves distance to Ttrue? Hill climb worsens distance to Ttrue? No change in distance to Ttrue? Avg drop in distance to Ttrue
ML tree 394 244 362 14.4%
MAP tree 277 227 496 − 1.0%
NJ tree 693 229 78 63.6%

Note: Using various tree estimators as the initial tree, we applied our hill-climbing to see if the path difference distance to the true tree could be locally improved. (See the text for details on squared path difference dp). The first two columns summarize how the local minimum Tfinal compared with the initial tree Tinit on the 1000 simulated data sets. The third column gives the average percentage by which hill-climbing decreases the (unsquared) path difference to the true tree. This is computed as 1 − mean(dp(Tfinal,Ttrue)/dp(Tinit,Ttrue)), where mean() denotes geometric mean. Note that we took the mean over all 1000 data sets. In any data set where the initial or final distance to the true tree is zero, we add 1 to the initial and final distance. This avoids multiplying or dividing by zero in the geometric mean.

TABLE 3.

Assessing local improvability of various tree estimators

Initial tree Hill climbimproves ρ^p? Hill climb worsens ρ^p? No change in ρ^p? Avg drop in ρ^p
ML tree 692 0 308 9.6%
MAP tree 547 0 453 5.6%
NJ tree 961 0 39 36.6%

Note: Using various tree estimators as the initial tree, we applied our hill-climbing to see if the empirical expected distance ρ^p could be locally improved. (See the text for details on ρ^p.) The first two columns summarize how the local minimum compared with the initial tree, on the 1000 simulated data sets. The third column gives the average percentage by which hill-climbing decreases ρ^p. This is computed as 1 − mean(ρ^p(Tfinal)/ρ^p(Tinit)), where mean() denotes geometric mean.

We indeed observed that NJ, ML, and to a lesser extent MAP trees can be improved by our hill-climbing. Tables 2 and 3 give summary information. In particular, Table 2 shows that our hill-climbing algorithm improved the distance to the true tree more times than it worsened the distance, for every type of starting tree. Even for MAP trees, the number of improvements was significantly higher than the number of worsenings (P < 0.013, binomial test). Tables 2 and 3 indicate that MAP trees tended to be nearly locally optimal.

Finally, to ensure that five random initial trees was sufficient for our hill-climbing, we repeated the simulation study with 20 random restarts. Our results were essentially unchanged; see our Supplementary material.

Using a Pentium dual core system running Red Hat Linux 4, the average running times to compute each initial tree and perform hill-climbing were no more than 1 or 2 minutes each. Detailed running times are given in Table 4.

TABLE 4.

Running time of hill-climbing from various tree estimators

Initial tree T0 Time to compute T0 Time to hill climb from T0
ML tree 76s 61s
NJ tree < 1s 92s
5 random trees ⋅ (30s avg) 152s

Note: Using various tree estimators as the initial tree, we applied our hill-climbing to improve empirical expected distance ρ^p. (See the text for details on ρ^p.) Below are the running times for computing initial trees and performing hill-climbing. We do not include the time to obtain samples from MrBayes.

REAL DATA

In addition to the simulation study, we also ran our software with five real data sets. First, we used two 20-taxa endophyte data sets from Schardl et al. (2008): an 800 bp alignment of β-Tubulin and a 565 bp alignment of translation–elongation factor 1-α. The other three data sets are from Weisrock et al. (2006). The original data comprised a 2765-bp alignment of sequence from members of the Salamander family. We created three data sets by choosing subsets of 25, 50, and 75 taxa.

Table 5 shows the running time results for our hill-climbing software. There is a marked sensitivity to the number of taxa, and we do not anticipate our implementation can handle beyond hundreds of taxa.

TABLE 5.

Running time for hill-climbing on real data

Data #Taxa Running time
TefA 20 1 min 36 s
TubB 20 1 min 41 s
Salamander 25 2 min 29 s
Salamander 50 11 min 57 s
Salamander 75 30 min 23 s

Note: We applied our hill-climbing optimization on five real data sets (see text for details). Above are the running times for our NNI hill-climbing, after obtaining 15,000 samples from MrBayes.

DISCUSSION

For phylogenetic reconstruction, the BE is a natural choice when accuracy is judged in terms of closeness to the true tree. In contrast to methods like ML, the BE directly maximizes its expected accuracy.

As observed in Holder et al. (2008), the popular consensus tree has a natural interpretation as a BE that minimizes the expected RF distance to the true tree. Thus, for the special case of RF distance, BEs have actually been studied for quite some time. In this paper, we have extended the use of BEs to other popular distances.

As part of an exploratory simulation study, we showed that hill-climbing can be used to find an empirical BE in practice, given a sample of trees from the posterior distribution. In particular, we used the squared path difference metric described in Steel and Penny (1993). Hill-climbing optimization produced tree estimates that were closer to the true tree, outperforming NJ, ML, and MAP. And in the majority of cases, hill-climbing improved distance to the true tree, even when the initial tree was obtained by hill-climbing optimization of the likelihood. We consider this very encouraging for future work on hill-climbing approaches for BEs.

Systematists are best qualified to help choose which types of distances should be used to compare trees. On the theoretical front, some interesting new distances are being studied such as the geodesic distance (Kupczok et al. 2008, Owen 2008, Owen 2009, Owen and Provan 2011). We believe BEs under novel distances comprise an interesting direction for future mathematical research. We also think BEs under the classical quartet distance might be interesting, in light of the close connection to quartet puzzling.

As an alternative to Bayesian sampling, bootstrapping also produces a collection of possible trees. One could apply the BE methodology to a collection of bootstrap replicate trees. In this setting, the “BE” would be called the median tree.

In this paper, we used NNI moves to apply the hill-climbing algorithm. One could also try more general tree moves such as subtree pruning and regrafting or tree bisection and reconnection, analogous to Hordijk and Gascuel (2005). Similarly, exploration strategies such as Tabu search (Glover 1986) or simulated annealing may give better performance.

One could also try more realistic simulations, especially “hard cases” where models are misspecified or data are generated by mixtures of trees. In our simulation, the performance of the BE tree was robust to different choices of accuracy measures. We have not yet studied its robustness across different types of hard data.

In this paper, we have focused on different types of tree features that can be used to define distance, for example, splits or quartets. Systematists are particularly interested in splits. Thus, one could also study different ways to define a distance based on splits. For example, Holder et al. (2008) considered a generalized RF distance that allows a specificity/sensitivity trade-off. We think another interesting way to modify RF would be to make the distance more “local.” For example, one could define a transformed distance d(T,T′) = min(dRF(T,T′),K) for a given ceiling constant K > 0. Then the BE could be interpreted as a “smoothed” ML tree, that is, the ML tree after the likelihood has been smoothed by a local convolution. This smoothed ML tree could provide a compromise between ML and consensus trees.

We suspect that path difference discourages excessive polytomies in the BE, unlike the consensus tree. However to our knowledge, the question is open, whether a distribution on fully resolved trees must yield a BE (under squared path difference) that is also fully resolved. This could be investigated either mathematically or empirically. In our current implementation of NNI hill-climbing, we deliberately restrict to fully resolved trees, but edge-collapsing moves could be added. Similarly, one could also compare our BE to various refinements of the consensus tree (e.g., greedy majority-rule consensus tree) and compare different refinement strategies.

Finally, we note that in our simulation study, ML and MAP trees were quite accurate. In fact, the ML/MAP trees were typically quite close to the BE, in terms of NNI moves. Thus, an ML/MAP (or approximate ML/MAP) tree might be useful as an initial guess for a BE tree.

SUPPLEMENTARY MATERIAL

Supplementary material, including data files and/or online-only appendices, can be found at http://www.sysbio.oxfordjournals.org/.

FUNDING

This work was supported by the Lane Fellowship in Computational Biology (to P.M.H.) and by the National Institutes of Health Research Project Grant Program (R01) from the Joint DMS/BIO/NIGMS Math/Bio Program (1R01GM086888-01 and 5R01GM086888-02 to P.M.H., W.L., D.H., T.F., and R.Y.).

Supplementary Material

Supplementary Data

Acknowledgments

The authors would like to thank D. Weisrock for many useful comments that improved this paper. We also thank the reviewers for constructive comments.

APPENDIX

Here, we give details of our hill-climbing optimization of expected loss. We assume that distance d between trees is measured by the squared euclidean distance specified by a vector space embedding v(),

graphic file with name sysbiosyr021fx29_ht.jpg

so that the expected loss associated with a tree estimate T′ is

graphic file with name sysbiosyr021fx30_ht.jpg

where the expectation is over T distributed according to the posterior distribution on the true tree.

A Simpler Reformulation of Expected Loss

Here, we review a classical bias–variance decomposition, which shows that the expected loss is equivalent to ρ^(T′):=‖v(T′)−μ‖2, where μ = 𝔼v(T). Using the identity ‖a − b‖2 = ‖a‖2 + ‖b‖2 − 2a·b, and linearity of expectation, we have

graphic file with name sysbiosyr021fx36_ht.jpg

and because T′ is a constant in the expectations, the above further simplifies to

graphic file with name sysbiosyr021fx31_ht.jpg

On the other hand, a similar argument gives a formula for ‖v(T′) − 𝔼v(T)‖2:

graphic file with name sysbiosyr021fx32_ht.jpg

Comparing the previous equations, all terms on the right are equal, except the first terms. Thus, the left sides are equal, after correcting the difference in terms:

graphic file with name sysbiosyr021fx33_ht.jpg

where μ = 𝔼[v(T)] and μ2 = 𝔼[‖v(T)‖2], and Var = μ2 − ‖μ‖2 does not depend on T′. The term ‖v(T′) − μ‖2 is the “bias,” and Var = tr(cov(v(T))) is the “variance.”

Hill-Climbing

We now briefly describe our hill-climbing implementation. The input for the algorithm is a list of trees T1,…,TN sampled from P(T|D), and an initial starting tree T0. The basic pseudo-code is as follows:

Algorithm Hill-climbing from an initial tree T0

INPUT: Samples T1,…,TN, and an initial tree T0.

OUTPUT: Local minimum T* of the empirical expected loss ρ^.

graphic file with name sysbiosyr021fx34_ht.jpg

In practice, allowing the hill-climbing algorithm to run until complete convergence might take too long. Thus, we have included several alternative stopping criteria in the UNTIL statement. (e.g., halt if a maximum number of loop iterations is reached.) In our simulation study, the algorithm always found a local maximum before halting.

For each proposed move Tcurrent→Tnew during hill-climbing, ρ^(Tnew) must be computed. A straightforward evaluation using the definition ρ^(T)=1N∑i=1Nd(T,Ti) would require N evaluations of d(), where N is the sample size. For squared euclidean distances, we can use ρ^(T)=d(μ^,T) instead. The computational expense to calculate d() depends on the choice of vector space embedding.

Under the path difference metric, trees are embedded in Inline graphic. Using depth-first search on a tree T, the embedding vector v(T) can computed in O(n2) time. Euclidean distance in Inline graphic can also be computed in O(n2) time.

For some vector space embeddings (e.g., quartet embedding vQ()), the embedding vectors for trees may be rather high dimensional and nonsparse. Then it may be faster to use the naive definition ρ^(T)=1N∑i=1Nd(T,Ti) directly. Indeed, quartet distance can be computed in O(nlogn) time for two trees of n taxa (Brodal et al., 2001), which is much faster than operations on quartet vectors, which have dimension O(n4).

References

  1. Berger JO. Statistical decision theory and bayesian analysis. Berlin (Germany): Springer-Verlag; 1985. [Google Scholar]
  2. Berry V, Gascuel O. On the interpretation of bootstrap trees: appropriate threshold of clade selection and induced gain. Mol. Biol. Evol. 1996;13:999–1011. [Google Scholar]
  3. Bolstad WM. Introduction to Bayesian statistics. 2nd ed. New York: John Wiley; 2007. [Google Scholar]
  4. Brodal G, Fagerberg R, Pedersen CN. Computing the quartet distance between evolutionary trees in time nlog2n. Algorithmica. 2001;38:731–742. [Google Scholar]
  5. Buneman P. The recovery of trees from measures of similarity. In: Hodson F, Kendall D, Tautu P, editors. Mathematics of the archaeological and historical sciences. Edinburgh: Edinburgh University Press; 1971. pp. 387–395. [Google Scholar]
  6. Desper R, Gascuel O. Theoretical foundation of the balanced minimum evolution method of phylogenetic inference and its relationship to weighted least-squares tree fitting. Mol. Biol. Evol. 2004;21:587–598. doi: 10.1093/molbev/msh049. [DOI] [PubMed] [Google Scholar]
  7. Eickmeyer K, Huggins P, Pachter L, Yoshida R. On the optimality of the neighbor-joining algorithm. Algorithms Mol. Biol. 2008 doi: 10.1186/1748-7188-3-5. 3(5) [DOI] [PMC free article] [PubMed] [Google Scholar]
  8. Eickmeyer K, Yoshida R. Geometry of neighbor-joining algorithm for small trees. In: Horimoto K, Regensburger G, Rosenkranz M, Yoshida H, editors. The proceedings of Algebraic Biology. Berlin (Germany): Springer-Verlag; 2008. pp. 82–96. [Google Scholar]
  9. Erdos P, Steel M, Szekely L, Warnow T. Local quartet splits of a binary tree infer all quartet splits via one dyadic inference rule. Comput. Artif. Intell. 1997;16:217–227. [Google Scholar]
  10. Estabrook G, McMorris F, Meaeham C. Comparison of undirected phylogenetic trees based on subtrees of four evolutionary units. Syst. Zool. 1985;34:193–200. [Google Scholar]
  11. Felsenstein J. PHYLIP (phylogeny inference package). Version 3.2. Cladistics. 1989;5:164–166. [Google Scholar]
  12. Glover F. Future paths for integer programming and links to artificial intelligence. Comput. Oper. Res. 1986;13:533–549. [Google Scholar]
  13. Guindon S, Gascuel O. A simple, fast, and accurate algorithm to estimate large phylogenies by maximum likelihood. Syst. Biol. 2003;52:696–704. doi: 10.1080/10635150390235520. [DOI] [PubMed] [Google Scholar]
  14. Holder MT, Sukumaran J, Lewis P. A justification for reporting the majority-rule consensus tree in Bayesian phylogenetics. Syst. Biol. 2008;57:814–821. doi: 10.1080/10635150802422308. [DOI] [PubMed] [Google Scholar]
  15. Hordijk W, Gascuel O. Improving the efficiency of SPR moves in phylogenetic tree search methods based on maximum likelihood. Bioinformatics. 2005;21:4338–2327. doi: 10.1093/bioinformatics/bti713. [DOI] [PubMed] [Google Scholar]
  16. Huelsenbeck J, Ronquist F. Mrbayes: Bayesian inference in phylogenetic trees. Bioinformatics. 2001;17:754–755. doi: 10.1093/bioinformatics/17.8.754. [DOI] [PubMed] [Google Scholar]
  17. Kimura M. A simple method for estimating evolutionary rates of base substitution through comparative studies of nucleotide sequences. J. Mol. Evol. 1980;16:111–120. doi: 10.1007/BF01731581. [DOI] [PubMed] [Google Scholar]
  18. Kupczok A, Haeseler AV, Klaere S. An exact algorithm for the geodesic distance between phylogenetic trees. J. comput. Biol. J Comput. Mol. Cell Biol. 2008;15:577–591. doi: 10.1089/cmb.2008.0068. [DOI] [PubMed] [Google Scholar]
  19. Mihaescu R, Levy D, Pachter L. Why neighbor-joining works. Algorithmica. 2007;54:1–24. [Google Scholar]
  20. Owen M. Distance computation in the space of phylogenetic trees [dissertation] Ithaca (New York: Cornell University; 2008. [Google Scholar]
  21. Owen M. Computing geodesic distances in tree space. 2009 Available from: http://arxiv.org/abs/0903.0696. [Google Scholar]
  22. Owen M, Provan JS. A fast algorithm for computing geodesic distances in tree space. IEEE/ACM Trans. Comput. Biol. Bioinform. 2011;8:2–13. doi: 10.1109/TCBB.2010.3. [DOI] [PubMed] [Google Scholar]
  23. Rambaut A, Grassly NC. Seq-gen: an application for the monte carlo simulation of dna sequence evolution along phylogenetic trees. Comput. Appl. Biosci. 1997;13:235–238. doi: 10.1093/bioinformatics/13.3.235. [DOI] [PubMed] [Google Scholar]
  24. Robinson DF, Foulds LR. Comparison of phylogenetic trees. Math. Biosci. 1981;53:131–147. [Google Scholar]
  25. Schardl CL, Craven KD, Speakman S, Lindstrom A, Stromberg A, Yoshida R. A novel test for host-symbiont codivergence indicates ancient origin of fungal endophytes in grasses. Syst. Biol. 2008;57:483–498. doi: 10.1080/10635150802172184. [DOI] [PubMed] [Google Scholar]
  26. Snir S, Rao S. Quartets maxcut: a divide and conquer quartets algorithm. IEEE/ACM Trans. Comput. Biol. Bioinform. 2010;7:704–718. doi: 10.1109/TCBB.2008.133. [DOI] [PubMed] [Google Scholar]
  27. Steel M. The complexity of reconstructing trees from qualitative characters and subtrees. J. Classification. 1992;9:91–116. [Google Scholar]
  28. Steel M, Penny D. Distributions of tree comparison metrics-some new results. Syst. Biol. 1993;42:126–141. [Google Scholar]
  29. Strimmer K, von Haeseler A. Quartet puzzling: a quartet maximum-likelihood method for reconstructing tree topologies. Mol. Biol. Evol. 1996;13:964–969. [Google Scholar]
  30. Weisrock DW, Papenfuss TJ, Macey JR, Litvinchuk SN, Polymeni R, Ugurtas IH, Zhao E, Jowkar H, Larson A. A molecular assessment of phylogenetic relationships and lineage accumulation rates within the family salamandridae (amphibia, caudata) Mol. Phylogenet. Evol. 2006;41:368–383. doi: 10.1016/j.ympev.2006.05.008. [DOI] [PubMed] [Google Scholar]

Associated Data

This section collects any data citations, data availability statements, or supplementary materials included in this article.

Supplementary Materials

Supplementary Data

Articles from Systematic Biology are provided here courtesy of Oxford University Press

RESOURCES