Skip to main content
Systematic Biology logoLink to Systematic Biology
. 2020 Jul 3;70(2):389–407. doi: 10.1093/sysbio/syaa048

Detecting Lineage-Specific Shifts in Diversification: A Proper Likelihood Approach

Giovanni Laudanno 1,, Bart Haegeman 2, Daniel L Rabosky 3, Rampal S Etienne 1
Editor: Jeremy Beaulieu
PMCID: PMC7875465  PMID: 32617585

Abstract

The branching patterns of molecular phylogenies are generally assumed to contain information on rates of the underlying speciation and extinction processes. Simple birth–death models with constant, time-varying, or diversity-dependent rates have been invoked to explain these patterns. They have one assumption in common: all lineages have the same set of diversification rates at a given point in time. It seems likely, however, that there is variability in diversification rates across subclades in a phylogenetic tree. This has inspired the construction of models that allow multiple rate regimes across the phylogeny, with instantaneous shifts between these regimes. Several methods exist for calculating the likelihood of a phylogeny under a specified mapping of diversification regimes and for performing inference on the most likely diversification history that gave rise to a particular phylogenetic tree. Here, we show that the likelihood computation of these methods is not correct. We provide a new framework to compute the likelihood correctly and show, with simulations of a single shift, that the correct likelihood indeed leads to parameter estimates that are on average in much better agreement with the generating parameters than the incorrect likelihood. Moreover, we show that our corrected likelihood can be extended to multiple rate shifts in time-dependent and diversity-dependent models. We argue that identifying shifts in diversification rates is a nontrivial model selection exercise where one has to choose whether shifts in now-extinct lineages are taken into account or not. Hence, our framework also resolves the recent debate on such unobserved shifts. [Diversification; macroevolution; phylogeny; speciation]


The literature abounds with examples of spectacular radiations, where specific clades seem to have an elevated diversification rate against a much slower background rate of diversification (Liem 1973; Mitter et al. 1988; Schluter 2000; Blount et al. 2008; Yoder et al. 2010). This phenomenon may occur due to increased mutation rates (Hua and Bromham 2017) but may also be caused by ecological opportunity (Simpson 1944, 1953; Wellborn and Langerhans 2015; Mahler et al. 2010 which may arise in three different ways: 1) antagonist extinction; 2) availability of a new environment, either due to dispersal to a new area or due to environmental change driven; or 3) a key innovation that enables escape from competition for niche space (Heard and Hauser 1995). The theoretical arena to study macroevolutionary diversification is the framework of stochastic birth–death models, where speciation is modeled as a birth event and extinction as a death event. These birth–death models allow for estimating speciation and extinction rates from phylogenetic trees. Nee et al. (1994) provided the mathematical tools to do so for the birth–death model with constant or time-dependent speciation and extinction rates. Their work has been the foundation for biologically more complex models. One example is the diversity-dependent birth–death model where speciation and extinction rates are influenced by the number of species in the same clade (Etienne et al. 2012). Another set of examples are the trait-dependent birth–death models, notably the State-dependent Speciation and Extinction (SSE) models (e.g., BiSSE by Maddison et al. (2007), QuaSSE by FitzJohn (2010), MuSSE by FitzJohn (2012), HiSSE by Beaulieu and O’Meara (2016) and SECSSE by Herrera-Alsina et al. (2018)). These models allow for trait shifts over macroevolutionary time and assign different diversification rate regimes to each trait value.

Methods to detect clades with elevated diversification rates without reference to traits or diversity have been developed and are available in a number of software programs. There are two types of approaches. The first type maps the rate shifts on the tree and then asks whether these rate shifts are statistically supported. Implementations of this type include MEDUSA (Alfaro et al. 2009), BAMM (Rabosky 2014), the Key Innovation model in DDD (Etienne and Haegeman 2012), and the split-SSE models in DIVERSITREE (FitzJohn 2010, 2012). The second type does not map the shifts explicitly on the phylogeny but assumes a multistate SSE model with each state having its own speciation and extinction rates, where the shifts in states (and hence in diversification rates) are modeled dynamically. Implementations of this type include the Lineage-Specific Birth–Death-Shift (LSBDS) models in RevBayes (Hoehna et al. 2019), the MultiState Birth–Death model (MSBD) in BEAST2 (Barido-Sottani et al. 2020), and ClaDS in RPANDA (Maliet et al. 2019). LSBDS and MSBD assume that lineages change to a different state along a branch, while ClaDS assumes that the state shift occurs during speciation. They are special cases of the SECSSE (Herrera-Alsina et al. 2018) and MISSE (Caetano et al. 2018) frameworks—which combine features of MuSSE (FitzJohn 2012), GeoSSE (Goldberg et al. 2011), ClaSSE (Goldberg and Igic 2012) and HiSSE (Beaulieu and O’Meara 2016)—applied to many concealed traits (and no examined traits). Here, we address implementations of the first type, that is, with shifts in diversification rates mapped on the phylogeny. These methods rely on the same framework as the SSE models but without state-dependence. We will refer to this framework as the D–E framework with mapped rate shifts, from the names of its core functions (Inline graphic and Inline graphic). However, here we show that the D–E framework, while mathematically sound in general (such as in applications to SSE models), cannot be applied to models with mapped shifts in rates. We demonstrate that it can lead to probabilities larger than 1. We propose a new, mathematically correct, analytical likelihood formula based on the functions originally introduced by Nee et al. (1994) for the constant-rate birth–death model of diversification without rate shifts. Using simulated data with a single shift, we show that our new likelihood performs better in parameter estimation than the incorrect likelihood. Furthermore, we extend our mathematical reasoning to multiple shifts and time-dependent and diversity-dependent models. Finally, we show that model selection in this framework requires making decisions on whether unobserved shifts (i.e., shifts on extinct lineages) are allowed or not.

Methods

The D–E framework

The D–E framework uses two variables: Inline graphic, the probability of observing the tipward part of the phylogeny at a given lineage at a given time Inline graphic in the phylogeny, and Inline graphic, the probability of a lineage alive at time Inline graphic to have no surviving descendants at the present. To compute the likelihood of the entire phylogeny, one computes Inline graphic and Inline graphic by integrating the following set of differential equations, for every branch from tip to the first rootward node:

graphic file with name M9.gif (1)
graphic file with name M10.gif (2)

which has the following solution for initial conditions Inline graphic and Inline graphic,

graphic file with name M13.gif (3)
graphic file with name M14.gif (4)

At a node the two Inline graphic-values of the two daughter branches are multiplied with one another and the speciation rate to obtain the Inline graphic of the parent branch. This value will then serve as the new initial condition to further integrate the system back in time to obtain Inline graphic at the next rootward node. This is then continued until one reaches the crown or stem of the phylogeny. The Inline graphic value at the stem or crown is the likelihood of the phylogeny. For Inline graphic nothing changes at the node, as this extinction probability is independent of observed branching points. We refer to the original papers by Alfaro et al. (2009) and Rabosky (2014), and to Appendix A for more details. The likelihood computed in this way is correct as long as the same rates are used for all lineages (observed and extinct) at a particular time. Below, we show that the likelihood is no longer correct if there are lineage-specific rates.

The D–E framework applied to mapped rate shifts leads to probabilities larger than 1

Rate shifts have been accommodated in the D–E framework in the software packages mentioned in the introduction (e.g., MEDUSA, BAMM, DDD) by using different rates of speciation (Inline graphic) and extinction (Inline graphic) for the lineage that undergoes a rate shift. There has been some debate on the initial condition for the equation for Inline graphic at the shift point that will be used for further rootward integration of the equations. Rabosky et al. (2017) proposed a “recompute” and a “pass-up” algorithm. The first, “recompute,” recomputes the Inline graphic using the rootward rates, whereas “pass-up” uses as initial condition at the time of the shift the Inline graphic already computed with the shifted rates for the subclade experiencing the rate shift from the present until the time of the rate shift. The “pass-up” algorithm is incorrect because the extinction rate that is needed in the computation of Inline graphic is computed for lineages that will not shift. The “recompute” algorithm is the correct one to compute the extinction rate, but we show here that the D–E framework applied to mapped shifts still suffers from another problem that yields an incorrect likelihood.

We look at a simple example of a phylogeny with only a single extant branch. This ensures that the Inline graphic we obtain at the root is a real probability and not a probability density due to the multiplication by Inline graphic at the nodes (formally the multiplication is with Inline graphic for an infinitesimal Inline graphic). We assume that at time Inline graphic a clade-wide rate shift in diversification rates occurs: all lineages present at that time undergo this shift. Subsequently, at time Inline graphic another shift occurs involving only one branch, which is the branch that we currently observe. Other branches become extinct before the present.

To study the full process, we divide it into three subprocesses (Fig. 1), each characterized by a set of speciation and extinction rates (Inline graphic):

Figure 1.

Figure 1.

Example phylogeny leading to an incorrect likelihood in the D–E framework. The phylogeny consists of a single branch from Inline graphic to Inline graphic, with a lineage-specific rate shift at Inline graphic (indicated by a Inline graphic-mark). This rate shift initiates subclade Inline graphic not included in main clade Inline graphic. In addition, the rates in the main clade change at Inline graphic from Inline graphic to Inline graphic. Open circles indicate species that go extinct before the present and therefore are invisible in the phylogeny. From Eq. (5) onwards, we consider the limit of Inline graphic.

  • for subprocess Inline graphic: rates Inline graphic and Inline graphic;

  • for subprocess Inline graphic: rates Inline graphic and Inline graphic. These rates do not only govern the diversification dynamics occurring in the interval Inline graphic, but also the diversification in the interval Inline graphic for all the lineages that do not undergo the lineage-specific rate shift at Inline graphic (which is why the “pass-up” algorithm is incorrect);

  • for subprocess Inline graphic: rates Inline graphic and Inline graphic.

We have used Inline graphic and Inline graphic to denote these subprocesses, because the first two processes occur in the main (Inline graphic) clade that does not undergo a clade-specific shift, but the last one occurs in the a subclade (Inline graphic) after a shift in a single lineage.

Adopting the D–E framework and the “recompute” strategy an analytical formula for the likelihood can be derived (Appendix A). In the limit of Inline graphic, that is, when the lineage-specific rate shift occurs immediately after the clade-wide range shift, this solution can be written in a compact way using the functions Inline graphic and Inline graphic from Nee et al. (1994):

graphic file with name M62.gif (5)

where

graphic file with name M63.gif (6)
graphic file with name M64.gif (7)

with the subscript Inline graphic referring to the rate regime (Inline graphic, Inline graphic or Inline graphic).

Exploring likelihood (5)—which is a probability—numerically for different values of Inline graphic and Inline graphic we observe that it exceeds unity in a large part of parameter space (left panel of Fig. 2), and hence must be incorrect.

Figure 2.

Figure 2.

Comparison of uncorrected and corrected likelihood for the example of Figure 1. We computed the likelihoods as a function of speciation rate Inline graphic and extinction rate Inline graphic and plotted the results as a heatmap in the Inline graphic plane. The other parameters are kept constant at Inline graphic. Left panel: The likelihood Inline graphic of the D–E framework is larger than one for a large part of parameter space (shades of red) and can reach values that are several orders of magnitude above one. Right panel: The corrected likelihood Inline graphic is always smaller than one. We have used Inline graphic, Inline graphic, Inline graphic in this numerical example.

We note that we need a clade-wide shift to get probabilities larger than 1. The reason is that to maximize the error in the likelihood, many species need to exist at the time of the shift, which requires a high speciation rate and a low extinction rate. However, in the sampled phylogeny only one lineage remains, so all lineages but one (namely the one that undergoes the shift) then need to go extinct, which requires low speciation rate and high extinction rate. This can only be achieved by having rates change over time, and a clade-wide shift is the simplest way of achieving that. This does not mean that the problem does not occur unless there are clade-wide shifts, but these clade-wide shifts are needed to obtain probabilities larger than 1 which is a clear signal that the likelihood calculation is incorrect. The likelihood calculation remains incorrect when the probabilities are smaller than 1.

Corrected likelihood—example

The D–E framework only prescribes how to compute the likelihood, but it does not explicitly state the model underlying this likelihood. What has been missing (as pointed out by May and Moore 2016) in applications of the D–E framework to mapped rate shifts, is a model for these shifts. Here, we propose a simple stochastic model for a lineage-specific rate shift, and we use it to yield the right likelihood formula for the example shown in the previous section (Fig. 1).

Our model runs from past to present. The simple stochastic model for the rate shift we propose is that at the rate shift time Inline graphic one of the extant species is chosen at random to undergo the rate shift. To construct the likelihood corresponding to this model, we use again functions Inline graphic (eq. (6)) and Inline graphic (eq. (7)) from Nee et al. (1994). We denote by Inline graphic the number of extant species immediately before the rate shift time. Then, the basic elements of the likelihood are:

  1. The single species present at the initial time Inline graphic undergoes a diversification process with rates Inline graphic and Inline graphic. The probability Inline graphic that it has Inline graphic descendant species immediately before the rate shift time Inline graphic (i.e., the 1 in the probability corresponds to the single species at Inline graphic and the Inline graphic to the number of descendants at Inline graphic), is
    graphic file with name M93.gif (8)
  2. The data (the reconstructed tree of Fig. 1) impose that the rate shifted species (governed by rates Inline graphic and Inline graphic) survives until the present and has only one descendant species. The probability Inline graphic of this event is
    graphic file with name M97.gif (9)
  3. The other Inline graphic species extant at time Inline graphic are governed by rates Inline graphic and Inline graphic and should become extinct in the time interval Inline graphic. The probability Inline graphic of this event is
    graphic file with name M104.gif (10)

Combining these elements we can write the corrected likelihood

graphic file with name M105.gif (11)

which can be simplified to

graphic file with name M106.gif (12)

It is instructive to rewrite the likelihood Inline graphic in a form similar to eq. (11),

graphic file with name M108.gif (13)

showing that the difference with Inline graphic resides in the additional factor Inline graphic in the summand of eq. (13). This factor Inline graphic is erroneous, given the explicit rate shift model we consider here (see Appendix B for more details), and it also causes the probabilities to exceed unity for some parameter values (left panel of Fig. 2).

The corrected likelihood Inline graphic solves the problem with probabilities larger than 1. This can be seen from eq. (12) by noting that Inline graphic. We also checked this numerically (right panel of Fig. 2).

We stress that defining a model for how the rate shift occurs is crucial, which explains why SSE-based approaches that model shifts dynamically (Barido-Sottani et al. 2020; Hoehna et al. 2019; Maliet et al. 2019) yield correct likelihoods. However, these models require the introduction of (an arbitrary number of) states and a rate shift parameter and are therefore arguably more complex than the model we propose here.

Corrected likelihood—general case

The corrected likelihood Inline graphic can be extended to general trees, as we show in Appendix C. Suppose the rate shift occurs in the Inline graphicth lineage of the Inline graphic lineages present at the rate shift time Inline graphic. Denote by Inline graphic the subclade including all descendants of the shifted lineage Inline graphic, by Inline graphic the main clade excluding Inline graphic, and by Inline graphic and Inline graphic the parts of Inline graphic before and after the rate shift, respectively (Fig. 3). Furthermore, denote by Inline graphic the operation of breaking the tree Inline graphic sensu Nee et al. (1994) into separate branches each of which we will index with Inline graphic. Here Inline graphic can be either Inline graphic, Inline graphic, or Inline graphic. Strictly, Inline graphic needs not be a single tree, but may consist of several trees. For example, in the top-left panel of Figure 3, Inline graphic consists of three clades which have stem age at Inline graphic: the clades that arise from lineages 2, 3, and 4.

Figure 3.

Figure 3.

Definition of subtrees used in likelihood formula (14). We consider a phylogeny with Inline graphic lineages at the rate shift time Inline graphic. Top-left panel: Suppose the rate shift occurs in the first lineage (Inline graphic). The subtree Inline graphic is the subclade containing all the descendant species of the shifted lineage (in red). The corresponding main clade is Inline graphic, which we decompose in a part Inline graphic before the shift (in green) and a part Inline graphic after the shift (in blue). Other panels: If the rate shift occurs in another branch (Inline graphic), the corresponding main and subclade are different (subtrees Inline graphic and Inline graphic).

The likelihood that the rate shift occurs in branch Inline graphic of the main clade, at time Inline graphic, and that it is observed, that is, that the rate shift is visible in the observed tree,

graphic file with name M147.gif (14)

where Inline graphic denotes the number of observed lineages in the phylogeny at time Inline graphic and the summation index Inline graphic denotes the number of species that come from branch Inline graphic in Inline graphic.

Conditional likelihoods

Likelihoods of diversification models are often conditioned on the existence of the phylogeny, that is, the survival of the two crown lineages (Nee et al. 1994), but also other conditionings have been discussed in the literature (Stadler 2012). Here, we discuss the standard conditioning on crown lineage survival (Inline graphic) and two additional conditional probabilities. The two additional ones still require that the two crown lineages survive to the present, but we additionally require that the lineage with the rate shift survives to the present with (Inline graphic) or without (Inline graphic) requiring that there is at least one other unshifted surviving lineage of the same crown lineage. To describe these conditional probabilities we need to introduce some notation. We denote by Inline graphic and Inline graphic, the two distinct subprocesses arising from left and right crown species, respectively. We assume that Inline graphic undergoes the rate shift at Inline graphic. With Inline graphic we denote the process arising from the shifted species, as before.

For the standard conditioning on the survival of the two crown lineages, we require Inline graphic to survive from the crown to the present, and Inline graphic from the crown to the shift, and either Inline graphic or Inline graphic to survive from the shift to the present. The conditional probability is given by

graphic file with name M165.gif (15)

where the factor of two arises from the symmetry of the system: swapping Inline graphic with Inline graphic yields a tree that is indistinguishable from the original one.

For the first new conditioning, we require Inline graphic to survive from the crown to the present, Inline graphic to survive from the crown to the shift, and Inline graphic to survive from the shift to the present, but Inline graphic is not required to survive to the present. The conditional probability Inline graphic is therefore given by

graphic file with name M173.gif (16)

As a second new conditioning, we require the survival to the present of both left and right crown species descendants in clade Inline graphic, as well as the survival of clade Inline graphic. Its probability, Inline graphic, is given by

graphic file with name M177.gif (17)

The observed tree satisfies the different conditionings. Hence, the conditional likelihood is obtained simply by dividing the likelihood (14) by either Inline graphic, Inline graphic, or Inline graphic.

Performance of the corrected likelihood in parameter estimation

We tested numerically the performance of the corrected likelihood formula versus the incorrect likelihood resulting from applying the D–E framework to mapped rate shifts for parameter estimation on phylogenies simulated under a constant-rate birth–death model with a single shift for various values of the generating parameters and two conditionings (Table 1). We did not use conditioning probability Inline graphic, because to be useful the simulations required the subclade to survive; using Inline graphic would have introduced biases unrelated to the quality of the estimation method.

Table 1.

Parameter settings used in the simulations. For each parameter setting we simulated 1000 trees. To simulate the subclades parameters Inline graphic and Inline graphic have been used; we did not vary them as they do not influence the inference outcome. We did not use conditioning Inline graphic because the simulations were conditioned on survival of the shited subclade.

Parameter Values
Inline graphic 0.2, 0.3, 0.4, 0.5
Inline graphic 0, 0.05, 0.1, 0.15
Inline graphic Inline graphic
Inline graphic Inline graphic, Inline graphic
Inline graphic Inline graphic, Inline graphic

We simulated 1000 trees for each parameter setting. We then maximized the likelihood for each tree to infer the best parameter values for Inline graphic, Inline graphic, Inline graphic, and Inline graphic. We find that the corrected likelihood produces less biased parameter estimates than the likelihood resulting from applying the D–E framework to mapped rate shifts (Fig. 4).

Figure 4.

Figure 4.

Comparison of the parameter estimates of the main clade diversification parameters Inline graphic and Inline graphic inferred by the corrected likelihood versus the D–E likelihood. The boxplots show, for various parameter settings displayed on the Inline graphic-axis, the distributions of the error ratios Inline graphic and Inline graphic, where Inline graphic, Inline graphic, Inline graphic, and Inline graphic were obtained via likelihood maximization and Inline graphic and Inline graphic are the known true values used to simulate the trees. Boxplots below 1 imply that the corrected likelihood is closer to the true generating value than the D–E likelihood. Parameter values are given in Table 1; the results for shift times Inline graphic and Inline graphic are shown in the same boxplot. For each unique parameter setting, Inline graphic trees were simulated and hence Inline graphic parameter sets estimated for each likelihood. The two different colors represent the two parameters, while the two panels represent different conditionings (Inline graphic and Inline graphic, see eqs. (16) and (17)).

Extending the corrected likelihood Inline graphic to time-dependent and diversity-dependent diversification rates

When the diversification rates depend on time, the basic structure presented in the previous section still holds. However, according to Nee et al. (1994), the core functions (6) and (7) have to be replaced with

graphic file with name M218.gif (18)
graphic file with name M219.gif (19)

where

graphic file with name M220.gif (20)

The corrected likelihood can also be extended to diversity-dependent rates. To do so, we make use of the general framework first introduced in Etienne et al. (2012), which was later used to study the specific case of a single lineage rate shift due to the introduction of a key innovation (Etienne and Haegeman 2012. The correction comes down to a division by the number of lineages at the shift time (see Appendix E for details), and has been implemented in version 4.3 of the DDD package (Etienne and Haegeman 2020).

Extending the corrected likelihood Inline graphic to multiple shifts

The extension of the corrected likelihood (14) to the case with multiple shifts is relatively straightforward. Although the formulas become increasingly cumbersome, the correction is based on the same idea as in the single-shift case. To account correctly for the choice of the species undergoing the rate shift at the rate shift time, we have to divide by the number of species in which the rate shift can occur. In Appendix C, we explicitly work out the correction for the case of two rate shifts occurring in the main clade, leading to the likelihood formula (C11).

The conditioning probabilities (15)–(17) can be also extended to the multiple-shifts case. To keep the computations manageable, we consider only the simplest extension. We require that already shifted subclades cannot undergo another shift, that is, shifts only happen in the main clade. Note that this need not be a strong restriction, because most applications involve large trees with a handful of shifts. In addition, as in conditioning probability Inline graphic, we require that there are surviving species in both crown clades and in all shifted subclades. The corresponding conditional likelihood can be easily evaluated within the diversity-dependent framework of Etienne et al. (2012), and has been implemented in version 4.3 of the DDD package (Etienne and Haegeman 2020).

Detecting rate shifts in phylogenetic trees

The corrected likelihood (14) can be used to ask whether a given lineage underwent a rate shift at the designated shift time Inline graphic. To do so, we must compare the likelihood (14) with a version of (14) where the rates of the main clade M and the subclade S are the same. That is, we compare a model where the rates actually change at the shift time with a model where the rates remain the same at the shift time (which we will refer to as a dummy shift).

It is important to note that this dummy-shift likelihood is different from Nee et al.’s likelihood. This can be understood by observing that the former likelihood depends on the predetermined lineage in which the rate shift possibly occurred, while the latter does not distinguish between lineages but treats all lineages equally. To recover Nee et al.’s likelihood as the reference case in the model comparison, we should ask whether the data contain evidence for a rate shift at a specified time Inline graphic without specifying the rate shift lineage. To address this question, we have to account for two possibilities: either the rate shift occurred in one of the observed lineages of the phylogeny, or it occurred in a lineage present at time Inline graphic, but that has become extinct after Inline graphic. We refer to these two cases as observed and unobserved rate shifts, respectively. The likelihood of an observed rate shift is simply obtained by summing Inline graphic across all branches present at time Inline graphic,

graphic file with name M229.gif (21)

The likelihood of an unobserved rate shift is given by

graphic file with name M230.gif (22)

The likelihoods for observed and unobserved shifts can be added to yield a (generalized) likelihood for a model with a rate shift, on any lineage in the phylogeny that was alive at Inline graphic:

graphic file with name M232.gif (23)

If we take the same rates for main clade M and subclade S (i.e., a dummy shift), we get (see Appendix D)

graphic file with name M233.gif (24)

where Inline graphic is the likelihood for a phylogeny produced under a constant-rate birth–death model without considering rate shifts, as provided by Nee et al. (1994). This shows that the generalized rate shift likelihood can be compared with the standard likelihood without rate shifts, if we do not specify a priori the lineage in which the rate shift might occur. Note that no such construction is possible when applying the D–E framework to mapped rate shifts, as this systematically overestimates the rate shift likelihood.

Discussion

We have shown that several methods developed for detecting shifts in diversification rates at particular points in phylogenies are based on an incorrect likelihood that could even yield probabilities larger than 1. Our new likelihood formulas—which even apply when diversification rates are time-dependent or diversity-dependent—can be used to correct these methods. This was already been done for the KI model in version 4.1 of the DDD package (Etienne and Haegeman 2020), which involved only a few lines of code (division by the number of species). For a single shift, DDD allows conditioning in three different ways, corresponding to the diversity-dependent extensions of Eqs. (15)–(17). For multiple shifts, only the last conditioning is feasible, under the additional assumption that shifts can only occur in the main clade. We noticed that the results for two different conditionings were similar for a single shift, so we are confident that this restriction is not very severe. For multiple shifts, the DDD package only contains the likelihood calculation, not a function to do likelihood optimization. This could be done by integrating this likelihood calculation with BAMM, MEDUSA, or related multishift methods.

Our framework has identified four ways to ask questions on rate shifts at a given shift time. One can ask whether a rate shift occurred in a particular observed lineage in the phylogeny at the shift time, whether it occurred in any observed lineage present at the shift time, whether it occurred in any unobserved lineage present at the shift time, or whether it occurred at all at the given shift time (either in an observed or unobserved lineage). We have provided likelihood formulas for all four cases. This was possible because we provided an explicit model for the choice of the lineage on which the rate shift occurs. Moore et al. (2016) already remarked that such a model was missing in BAMM which they considered problematic for estimating evolutionary rates, although the Moore et al. (2016) critique employed the problematic D–E framework applied to mapped rate shifts. With our formulas, we have offered a solution to these problems. In all four cases, we have also provided the appropriate null model for model comparison, that is, a model where there is a shift but rates do not actually change (dummy shift). We have also shown that we recover the well-established likelihood of a constant-rate or time-dependent birth–death model (Nee et al. 1994) in case we allow this dummy shift to occur anywhere in the phylogeny.

While we offer a likelihood that can account for unobserved rate shifts, the use of maximum likelihood to infer shifts on extinct branches is not especially useful in practice. Indeed, this will lead to the estimate of the shifted extinction rate being infinite, as this makes the observed phylogeny most likely. Even when fixing the extinction rate at a given value (or not allowing it to shift), maximizing the likelihood will lead to the shifted speciation rate being estimated to be 0 in unobserved lineages. Fortunately, the generalized likelihood developed to answer the question whether a shift occurred at all at the given shift time (either in an observed or unobserved lineage)—of which the likelihood for unobserved shifts is an integral part—will not suffer from this problem as any inferred shifted extinction rate applies to both observed and unobserved lineages. To assess whether estimates are biased, one should perform an extensive analysis of simulated trees which is beyond the scope of the current article. An alternative is that for a specific study one conducts simulations with the estimated parameters and checks whether the distribution of parameters estimated from the simulations is in line with the original estimated parameters used to generate the simulated phylogenies. In fact, this parametric bootstrap procedure is useful for any parameter estimation method.

Because the likelihoods implemented in most rate shift methods suffer from the largely unappreciated issue described in this article, we suggest that researchers interpret results from these methods with caution. The likelihoods obtained with these methods are systematically too large, and hence using these methods to detect rate shifts may be subject to false positives. Simulation studies have generally found that BAMM appears conservative with respect to the inference of rate heterogeneity (Maliet et al. 2019), and rate estimates have been shown to be reasonable across a broad range of parameter space (Title and Rabosky 2019). However, the fact that the likelihood expression is incorrect implies that BAMM and other approaches may behave unexpectedly in some areas of parameter space or on some data sets. We expect the errors to be largest when there are many species at the time of the shift which do not survive to the present, but the specific conditions under which this situation arises may be hard to identify. Researchers who use these methods should be vigilant in assessing whether results are sensible and should strive to cross-check inferences with alternative methods wherever possible. Our numerical results show how, on sets of simulated trees, the new likelihood (14) performs consistently better in estimating the rates (i.e., produces less bias) than the likelihoods based on applying the D–E framework to mapped rate shifts. In some simulations the difference was large, in others it seemed small, but it is difficult to say beforehand when estimates will deviate mostly between the corrected likelihood and the likelihood resulting from applying the D–E framework to mapped rate shifts.

As stated in the introduction, alternative approaches to detecting shifts in diversification rates have been developed that do not explicitly map shifts in diversification rates on the phylogeny, but rather look for evidence for multiple rate regimes in general across the phylogeny (Barido-Sottani et al. 2020; Hoehna et al. 2019). These approaches—which rely on the same mathematical equations—do not suffer from the problems we identified here, but they resort to ancestral state reconstruction to identify what parts of the phylogeny are governed by a rate regime, that is, the shifts in diversification are not fixed, but one obtains a (posterior) probability distribution for the shift positions. Another recently developed approach assumes that each speciation event is accompanied by (usually small) rate shifts in each descendant lineage and allows reconstruction of branch-specific rate estimates (Maliet et al. 2019). However, in each of these frameworks, it is not possible to directly link rate shifts to historical events that happened at specific times: shifts are either assumed to happen with each speciation event (Maliet et al. 2019) or the model determines where the most probable shift locations are (Barido-Sottani et al. 2020; Hoehna et al. 2019). When linking rate shifts to historical events such as glaciation (e.g., Weir et al., 2016) or mountain uplift (e.g., Chaves et al., 2011) is the ultimate goal of rate shift analyses, our likelihood framework is ideally suited.

Lastly, we emphasize that our approach can also be used for diversity-dependent diversification models, which is not the case for the three recent approaches mentioned above (Barido-Sottani et al. 2020; Hoehna et al. 2019; Maliet et al. 2019).

It has recently been suggested that making inference on diversification scenarios from phylogenies of extant species may be a futile enterprise, because this type of data cannot distinguish between models assuming constant speciation and extinction rates and an infinite set of models with time-dependent speciation and extinction models (Louca and Pennell 2020), which is a generalization of the results by Nee et al. (1994) that a model with constant speciation and extinction rates is equivalent to a model without extinction and time-dependent speciation rate. While this problem of nonidentifiability has not yet been mathematically shown to apply also to SSE models (Louca and Pennell 2020), diversity-dependent models (but see Etienne et al. 2016) or rate shift models as considered here, the results of Louca and Pennell (2020) have made clear that we can only draw conclusions on the models that we are comparing, and not on the existence of time-dependence, diversity-dependence or rate shifts in general.

In summary, we have described theoretical concerns with the likelihood expression used by a number of diversification rate shift methodologies, and we have provided a new likelihood formula for rate shifts that is mathematically consistent. We implemented this approach for macroevolutionary scenarios involving a single rate shift and found that the approach performed better than the incorrect D–E framework. We hope that our formulas or algorithms to compute the likelihoods will be applied in likelihood-based inference tools such as BAMM and MEDUSA.

Appendix A: D–E likelihood for example phylogeny of Fig. 1

Here, we compute the D–E likelihood for the tree of Fig. 1. We apply the “recompute” algorithm and use the solutions (3) and (4) for the functions Inline graphic and Inline graphic.

In the example, the phylogeny has only a single extant branch. This implies that the D–E likelihood we obtain at the root is a real probability and not a probability density due to the multiplication by Inline graphic at the nodes (formally the multiplication is with Inline graphic for an infinitesimal Inline graphic). We assume that at time Inline graphic a clade-wide rate shift in diversification rates occurs: all lineages present at that time undergo this shift. Subsequently, at time Inline graphic another shift occurs involving only one branch, which is the branch that we currently observe. Other branches become extinct before the present.

The derivation of the D–E likelihood proceeds in several steps:

  • We solve the D–E equations in the interval Inline graphic with rates Inline graphic and Inline graphic. For initial conditions, Inline graphic and Inline graphic the solution reads
    graphic file with name M247.gif (A1)
    graphic file with name M248.gif (A2)
    where the index 1 refers to the first computation in the interval Inline graphic.
  • We solve the D–E equations a second time in the interval Inline graphic, this time with rates Inline graphic and Inline graphic. This is required for the “recompute” variant of the D–E framework. The initial conditions are again Inline graphic and Inline graphic, so that
    graphic file with name M255.gif (A3)
    graphic file with name M256.gif (A4)
    where the index 2 refers to the second computation in the interval Inline graphic.
  • We solve the D–E equations in the interval Inline graphic with rates Inline graphic and Inline graphic. The initial conditions are Inline graphic (species that originate in Inline graphic and become extinct in Inline graphic are governed by rates Inline graphic and Inline graphic) and Inline graphic (the observed branch in Inline graphic is governed by rates Inline graphic and Inline graphic). We get
    graphic file with name M270.gif (A5)
    graphic file with name M271.gif (A6)
  • We solve the D–E equations in the interval Inline graphic with rates Inline graphic and Inline graphic. Using as initial conditions the expressions for Inline graphic and Inline graphic, we get
    graphic file with name M277.gif (A7)

Then, the likelihood as prescribed by the D–E framework (which we are going to show to be incorrect) is Inline graphic.

To make formulas clearer, we set Inline graphic, that is, the lineage-specific rate shift occurs immediately after the clade-wide range shift. Then, eqs. (A1)–(A7) can be expressed in terms of the functions Inline graphic and Inline graphic introduced by Nee et al. (1994), already stated in eqs. (6) and (7), which yields

graphic file with name M282.gif (A8)
graphic file with name M283.gif (A9)
graphic file with name M284.gif (A10)

which establishes eq. (5).

Appendix B: Corrected likelihood for phylogeny of Figure 1

In the main text, we presented a short derivation of the corrected likelihood for the example phylogeny shown in Figure 1. Here, we provide an introduction to the approach of Nee et al. (1994) on which the derivation is based, and a comparison of the corrected likelihood with the incorrect likelihood computed within the D–E framework.

A short introduction to Nee et al. (1994)

Many properties of the constant-rate birth–death process can be expressed in terms of functions Inline graphic and Inline graphic introduced by Nee et al. (1994),

graphic file with name M287.gif

where Inline graphic is the speciation rate and Inline graphic the extinction rate. In particular, the probability that the process starting at time Inline graphic with a single species has Inline graphic descendant species at a later time Inline graphic is given by

graphic file with name M293.gif (B1)

We see that the number of species is a geometric distribution with parameter Inline graphic with an added zero term (Nee et al. 1994). This formula can be generalized to the probability that Inline graphic species at time Inline graphic have Inline graphic species at time Inline graphic, denoted by Inline graphic. The computation exploits the fact that the Inline graphic species at time Inline graphic undergo independent dynamics, so that the number of species at time Inline graphic is the Inline graphic-fold convolution product of Inline graphic. For example, the formula for the case Inline graphic reads

graphic file with name M306.gif (B2)

Nee et al. (1994) showed that under the constant-rate birth–death model the likelihood of a phylogeny can be computed as a product over branches. Each of these branches runs from a branching time Inline graphic to the present time Inline graphic. The corresponding likelihood contribution is equal to the probability that a speciation event occurs at Inline graphic multiplied by the probability that the branch has a single descendant species at the present time Inline graphic. Explicitly,

graphic file with name M311.gif (B3)

The infinitesimal factor Inline graphic is required to impose that the branching time occurs in the infinitesimal interval Inline graphic. Because, this factor does not affect likelihood maximization, we will leave it out of the likelihood formulas (so that the likelihood is no longer a probability, but a probability density). Taking the product over branches, we obtain the (unconditioned) likelihood of the phylogeny

graphic file with name M314.gif (B4)

where Inline graphic denotes the number of branching events in the phylogeny and Inline graphic denotes the crown age. Because the likelihood is obtained by decomposing the phylogeny into branches, the approach of Nee et al. (1994) is sometimes referred to as “breaking the tree.” In Appendix C, we present an alternative derivation of eq. (B4), which in contrast to the argument of Nee et al. (1994) can be easily generalized to phylogenies with rate shifts.

Comparison of D–E likelihood and corrected likelihood

From the expressions of the likelihoods Inline graphic and Inline graphic, we see that the difference resides in an additional factor Inline graphic. To interpret this difference, we isolate in both likelihoods the probability that, given that there are Inline graphic species at the rate shift time Inline graphic, one of them undergoes the rate shift and has surviving descendant species at the present time Inline graphic, while the other Inline graphic species has no descendant species at Inline graphic. This probability is

graphic file with name M325.gif (B5)
graphic file with name M326.gif (B6)

In Figure B1, we construct this probability by explicitly considering all possible full trees corresponding to a specific reconstructed tree. Note that in the figure we use simplified notation and set Inline graphic and Inline graphic.

Figure B1.

Figure B1.

Demonstration of correct likelihood formula. a) Case of phylogeny without rate shift. We consider a reconstructed tree consisting of a single branch running from Inline graphic to Inline graphic. We assume that there are three extant species at an intermediate time Inline graphic (indicated by the middle vertical line) and consider the dynamics of these three species from Inline graphic to Inline graphic, all governed by rates Inline graphic and Inline graphic. There are three possible full trees, each having probability Inline graphic, so that the total probability is Inline graphic. b) Case of phylogeny with rate shift. The reconstructed tree consists of a single branch with an observed rate shift at the intermediate time Inline graphic. We assume again that there are three extant species at Inline graphic, each of them having probability Inline graphic of undergoing the rate shift. The rate shifted species has rates Inline graphic; the other species have rates Inline graphic. We show the nine combinations obtained by first selecting the species undergoing the rate shift, and second selecting the species surviving until the present. Only three of these nine combinations have the correct reconstructed tree (consistent combinations are plotted in blue); the other six combinations correspond to unobserved rate shifts. Each of the three consistent full trees have probability Inline graphic, so that the total probability is Inline graphic. Symbols have same meaning as in other figures (Inline graphic-mark: rate shift; filled circle: species surviving until present; open circle: species going extinct before present).

It is instructive to first consider the case without rate shift (Fig. B1a). We consider a reconstructed tree consisting of a single branch. If there are Inline graphic species at the intermediate time Inline graphic, there are Inline graphic possible full trees, because each of the Inline graphic species extant at time Inline graphic can be chosen to survive. Each full tree has probability Inline graphic, so that the total probability is Inline graphic. Note that this probability cannot be larger than one; indeed, when adding the probabilities that none or more than one species survives, we get

graphic file with name M353.gif (B7)

Next consider the case with rate shift (Fig. B1b). As in the example of Fig. 1, we consider a reconstructed tree with a single branch and an observed rate shift. We see that there are Inline graphic possible full trees, corresponding to two choices, each one having Inline graphic options. First, we have to choose the species that is undergoing the rate shift. Second, we have to choose the species that is going to survive, which can be either the species that has undergone the rate shift or one of the Inline graphic other species. Importantly, not all of these full trees are consistent with the reconstructed tree. In particular, for Inline graphic of them the rate shift is unobserved. The Inline graphic full trees for which the rate shift is observed in the corresponding phylogeny each have probability Inline graphic, so that the total probability is Inline graphic. This probability cannot be larger than one, because when adding the probabilities that none or more than one species survives,

graphic file with name M361.gif (B8)

This computation demonstrates that formula (B6), and hence likelihood Inline graphic, is correct, and that formula (B5), and hence likelihood Inline graphic, is not. The latter, which can be seen as a naive generalization of the formula without rate shift, does not account correctly for unobserved rate shifts (i.e., rate shifts that occur in a species that is not represented in the phylogeny). Note that formula (B5) is also different from the probability of having either an observed or an unobserved rate shift. The correct probability for this case is

graphic file with name M364.gif (B9)

Appendix C: Corrected likelihood for general phylogenies

In this appendix, we derive the likelihood formula for a general phylogeny with one or several lineage-specific rate shifts. We start the computation, which is related to the “breaking the tree” argument of Nee et al. (1994), by deriving the likelihood again for a general phylogeny without rate shift.

A useful identity

We will repeatedly use the following identity:

graphic file with name M365.gif (C1)

This identity can be understood by introducing a sampling process at time Inline graphic, in which each extant species is sampled with probability Inline graphic. Multiplying the left-hand side of eq. (C1) by Inline graphic, we see that

graphic file with name M369.gif

is the probability that a species at time Inline graphic has Inline graphic descendant species at time Inline graphic and one sampled descendant species. We establish identity (C1) by computing this same probability in a different way. To do so, we consider the Inline graphic species extant at time Inline graphic. For this group of Inline graphic species to have one sampled descendant species at time Inline graphic, there should be one of the Inline graphic species with a single sampled descendant species, and all other species should have no sampled descendant species. Therefore, the probability Inline graphic can also be computed as

graphic file with name M379.gif

Here, Inline graphic is the number of species at Inline graphic (before sampling) descendant from the single species extant at Inline graphic with a sampled descendant species at Inline graphic; and Inline graphic is the number of species at Inline graphic (before sampling) descendant from the other Inline graphic species extant at Inline graphic. From the Inline graphic species, one should be sampled; from the Inline graphic species none should be sampled. Dividing the last expression by Inline graphic, we obtain the right-hand side of eq. (C1).

Case without rate shift

We construct the likelihood of a tree under speciation–extinction dynamics without rate shift. This likelihood will be extended below to speciation–extinction dynamics with one or more rate shifts. The argument is related to the “breaking the tree” approach of Nee et al. (1994). As in the proof of eq. (C1), we consider a sampling process at the present time Inline graphic with sampling probability Inline graphic.

We start by decomposing the tree into simple branches, that is, branches of the reconstructed tree without branching events. See left panel of Figure C1, where the simple branches are labeled by letters “a” to “n.” We denote the time interval of branch Inline graphic by Inline graphic. We distinguish internal and boundary simple branches: internal branches are those for which Inline graphic, and boundary branches are those for which Inline graphic. We denote the set of internal simple branches by Inline graphic, and the set of boundary simple branches by Inline graphic. For the example of Figure C1 (left panel), we have

graphic file with name M399.gif
Figure C1.

Figure C1.

Decomposing a phylogeny in simple branches. Left panel: Example tree without rate shift, decomposed in simple branches labeled by letters “a” to “n.” Right panel: Same example tree, but this time with rate shift at Inline graphic. Simple branches that contain the rate shift are split, resulting in a larger set of simple branches (labeled by letters “a” to “r”).

For each internal simple branch Inline graphic, we denote by Inline graphic the number of descendant species at the end of the branch (at time Inline graphic. One of these descendant species is represented in the tree. For the other Inline graphic descendant species, we keep track of the number of descendants at Inline graphic; we denote this number by Inline graphic. For each boundary simple branch Inline graphic, we denote by Inline graphic the number of descendants at Inline graphic in addition to the species represented in the tree (hence, Inline graphic descendant species in total).

The numbers Inline graphic and Inline graphic allow us to write down the likelihood

graphic file with name M413.gif (C2)

where we used short-hand notation for the multidimensional sums, for example,

graphic file with name M414.gif

Equation (C2) can be understood as follows. The product on the first line corresponds to internal simple branches. The term for branch Inline graphic contains the probability of having Inline graphic descendants at Inline graphic, a factor Inline graphic related to the selection of the descendant species that is represented in the tree, the probability that the other Inline graphic species at Inline graphic have Inline graphic descendants at Inline graphic, and the probability that none of the latter descendants is sampled. The product on the second line corresponds to boundary simple branches. The term for branch Inline graphic contains the probability of having Inline graphic descendants at Inline graphic, a factor Inline graphic related to the selection of the sampled descendant species, and the probability of sampling this species and not sampling the other species.

Equation (C2) can be simplified by combining simple branches. In particular, the terms relating to an internal branch can be incorporated in the terms relating to the boundary branch to which it is connected. For example, referring to Figure C1 (left panel), consider branches “a” and “e,” which are an internal and a boundary simple branch, respectively. The terms in eq. (C2) associated with branches “a” and “e” are

graphic file with name M427.gif (C3)

where we have applied eq. (C1) in the last line. We see that the part of the likelihood corresponding to the composed branch “ae” (composed of simple branches “a” and “e,” with Inline graphic and Inline graphic, where Inline graphic) has the same form as a boundary simple branch Inline graphic in eq. (C2). Hence, we can absorb an internal simple branch in the boundary simple branch to which it is connected.

By repeatedly absorbing internal simple branches, we obtain boundary branches that are increasingly composed, until there are no internal simple branches left in eq. (C2). Denoting the resulting set of boundary branches by Inline graphic, we obtain

graphic file with name M433.gif (C4)

and for the case where all species are sampled (set Inline graphic)

graphic file with name M435.gif (C5)

This is the “breaking the tree” likelihood of (Nee et al., 1994), see eq. (B4).

Note that there are several ways of combining simple branches into composed ones. For example, for the tree shown in Fig. C1 (left panel), two possible sets of boundary branches are

graphic file with name M436.gif

However, these sets lead to the same value of likelihoods (C4) and (C5). In fact, the likelihoods only depend on the branching times, and the latter do not depend on the specific choice of composed branches.

Case of a single rate shift

The “breaking the tree” approach can also be used to construct the likelihood of a tree with a rate shift. For the rate shift model described in the main text, we have to divide by the total number of species extant at the rate shift time Inline graphic. Hence, we have to keep track of the total number of species at Inline graphic.

First, note that the subclade with the rate shift can be dealt with separately from the main clade. For the subclade, we can apply the likelihood formula for a tree without rate shift. The subclade tree starts at the rate shift time Inline graphic and continues until the present time Inline graphic. Here, we derive the likelihood formula for the main clade. For the example phylogeny of Figure C1 (right panel) the main clade corresponds to the entire tree except branches Inline graphic.

We decompose the main clade into simple branches. In the case of a rate shift, all simple branches are split at the rate shift time, see Figure C1 (right panel). We distinguish internal simple branches before the rate shift (with Inline graphic; set denoted by Inline graphic), boundary simple branches before the rate shift (with Inline graphic; set denoted by Inline graphic), internal simple branches after the rate shift (with Inline graphic; set denoted by Inline graphic) and boundary simple branches after the rate shift (with Inline graphic; set denoted by Inline graphic). For the example of Fig. C1 (right panel),

graphic file with name M450.gif

As before, we introduce the numbers Inline graphic and Inline graphic for internal simple branch Inline graphic, and Inline graphic for boundary simple branch Inline graphic. For an internal branch, Inline graphic stands for the number of descendant species at Inline graphic. Only one of the Inline graphic species is represented in the phylogeny; the other Inline graphic species have Inline graphic descendant species at time Inline graphic (for a branch before the rate shift) or at time Inline graphic (for a branch after the rate shift). Similarly, for a boundary branch, Inline graphic stands for the number of descendant species not represented in the phylogeny at time Inline graphic (for a branch before the rate shift) or at time Inline graphic (for a branch after the rate shift).

Using the numbers Inline graphic and Inline graphic we can construct the likelihood for the main clade

graphic file with name M468.gif (C6)

The first and second line impose the branching times before the rate shift, while keeping track of the total number of species at the rate shift. This number is equal to Inline graphic, by which we divide in the third line, where Inline graphic denotes the number of species represented in the phylogeny at the time of the shift (in Fig. C1 (right panel) Inline graphic). The other factor on the third line imposes that the species that are not represented in the phylogeny, of which there are Inline graphic, do not have sampled species. The fourth and fifth line impose the branching times after the rate shift, and require that the species that are (not) represented in the phylogeny are (not) sampled.

As for the case without rate shift, the likelihood expression can be simplified. We absorb internal into boundary branches, until there are no internal branches left. This leads to a set of boundary branches before the rate shift, and a set of boundary branches after the rate shift, which we denote by Inline graphic and Inline graphic, respectively. For example, for the tree of Fig. C1 (right panel), these sets could be

graphic file with name M475.gif

Other ways of combining branches are possible, leading to different sets Inline graphic and Inline graphic, but result in the same likelihood value,

graphic file with name M478.gif (C7)

If all species are sampled, we get (by setting Inline graphic)

graphic file with name M480.gif (C8)

This is the likelihood formula reported in the main text, see eq. (14).

Case of multiple rate shifts

Consider two rate shifts at times Inline graphic and Inline graphic. We distinguish two cases. First, we assume that the second rate shift occurs in the subclade with the first rate shift (Fig. C2, left panel). The corresponding likelihood can be readily constructed from the single rate shift formula. Indeed, because the main-clade diversification dynamics after Inline graphic are unaffected by the second rate shift, the part of the likelihood dealing with the main clade follows directly from the one for a single rate shift. Similarly, because the subclade diversification dynamics are unaffected by the main clade, also the part of the likelihood dealing with the subclade follows directly from the one for a single rate shift.

Figure C2.

Figure C2.

Example phylogenies with two rate shifts. Colors indicate the different rate regimes: main clade in blue, subclade initiated by first rate shift in green, subclade initiated by second rate shift in red. Left panel: The second rate shift occurs in the subclade of the first rate shift. The likelihood of this phylogeny is the product of the one-shift likelihood for the main clade, the one-shift likelihood for the first subclade, and the no-shift likelihood for the second subclade. Right panel: The second rate shift occurs in the main clade. The total likelihood is the product of the two-shifts likelihood for the main clade, the no-shift likelihood for the first subclade, and the no-shift likelihood for the second subclade.

Here, we work out the second, more complicated case, in which the second rate shift occurs in the main clade (Fig. C2, right panel). We denote the sets of simple branches by Inline graphic and Inline graphic (branches before Inline graphic), Inline graphic and Inline graphic (branches between Inline graphic and Inline graphic) and Inline graphic and Inline graphic (branches after Inline graphic). We again introduce numbers Inline graphic and Inline graphic to keep track of the total number of species at the two rate shifts. Then, the part of the likelihood relating to the main clade (i.e., the blue clade in Fig. C2) is

graphic file with name M496.gif (C9)

The latter expression can be simplified by incorporating internal branches into longer boundary branches. Denoting the resulting sets of boundary branches by Inline graphic, Inline graphic, and Inline graphic, we obtain

graphic file with name M500.gif (C10)

If all species are sampled, we get

graphic file with name M501.gif (C11)

Appendix D: Likelihood for unobserved rate shift

It is intuitively clear that the rate shift model in which the rate shift has no effect, that is, when rate shifted rates Inline graphic are equal to nonrate shifted rates Inline graphic, should be connected to the model without rate shift. Here, we show how the likelihood formula with rate shift should be combined to recover Nee et al.’s (1994) likelihood. More precisely, we prove that

graphic file with name M504.gif (D1)

We start by noting that when the rate shift has no effect (i.e., when setting Inline graphic), the likelihoods Inline graphic and Inline graphic can be rewritten as

graphic file with name M508.gif (D2)
graphic file with name M509.gif (D3)

with common factor Inline graphic given by

graphic file with name M511.gif (D4)

Hence,

graphic file with name M512.gif (D5)

Substituting the expression for Inline graphic,

graphic file with name M514.gif (D6)

where in the second equality we have applied eq. (C1) with Inline graphic (and hence Inline graphic and Inline graphic). This concludes the proof of eq. (D1).

Appendix E: Rate shifts in diversity-dependent model

The corrected likelihood Inline graphic, eq. (14), can be extended to the case of diversity-dependent diversification. Here, we describe how this can be done within the framework of Etienne et al. (2012). In this approach the total number of species, including the unobserved ones, is tracked through time. Therefore, the likelihood correction of eq. (14), which basically consists in the division by the total number of species present at the rate shift, can be readily implemented.

The framework of Etienne et al. (2012) is built on the quantities Inline graphic, the probabilities that the diversification process is consistent with the observed phylogeny from the starting time (typically crown age Inline graphic) to the current time Inline graphic, with Inline graphic visible (i.e., represented in the phylogeny) and Inline graphic invisible (i.e., not represented in the phylogeny, as they will go extinct before the present time Inline graphic or they are unsampled in the data) species at time Inline graphic. The probabilities Inline graphic are computed forward in time, from Inline graphic to Inline graphic. We introduce the vector Inline graphic with components Inline graphic for all Inline graphic. Then, for a phylogeny with Inline graphic tips and without rate shift,

graphic file with name M533.gif (E1)

Starting from the initial vector Inline graphic at crown age, we repeatedly apply matrices Inline graphic between branching times Inline graphic and Inline graphic and matrices Inline graphic at branching time Inline graphic. Here, the branching times are time-ordered (i.e., Inline graphic), so that at branching time Inline graphic the phylogeny transits from Inline graphic to Inline graphic branches. The (unconditioned) likelihood of the tree under the diversity-dependent diversification model is then obtained as the Inline graphic component of Inline graphic.

The matrices Inline graphic appearing in eq. (E1) is obtained by solving the linear differential equation

graphic file with name M547.gif (E2)

so that Inline graphic, with the matrices Inline graphic given by

graphic file with name M550.gif (E3)

Here, the speciation rates Inline graphic and extinction rates Inline graphic can depend on the number of extant species Inline graphic at the event times. The matrices Inline graphic are given by

graphic file with name M555.gif (E4)

For the case of a lineage-specific rate shift, we apply the same computation from Inline graphic to the rate shift time Inline graphic. At the rate shift, we choose the species that is undergoing the rate shift, which corresponds to dividing by the total number of species (both visible and invisible) extant at Inline graphic. We then continue the computation from Inline graphic to Inline graphic, taking into account that the main clade has lost one branch at the rate shift. Hence, eq. (E1) has to be modified to

graphic file with name M561.gif (E5)

with the matrices Inline graphic given by

graphic file with name M563.gif (E6)

Note that at branching time Inline graphic the main-clade phylogeny goes from Inline graphic to Inline graphic branches, and at branching time Inline graphic it goes from Inline graphic to Inline graphic branches.

The likelihood contribution Inline graphic of the main clade is obtained as the Inline graphic component of Inline graphic computed with eq. (E5). The likelihood contribution Inline graphic of the subclade can be computed with eq. (E1) starting at the rate shift time Inline graphic. By multiplying these two contributions, we get the (unconditioned) corrected likelihood for a phylogeny with an observed rate shift in a specific branch Inline graphic

graphic file with name M576.gif (E7)

Using techniques of Laudanno et al. (2020), it can be proven that this formula reduces to the likelihood (14) in the diversity-independent case.

In the same way as for the likelihood Inline graphic of an observed rate shift, diversity-dependent extensions can be derived for

  • the likelihood Inline graphic of an unobserved rate shift. Note however that in the diversity-dependent case a dummy rate shift (i.e., rates before and after rate shift are the same) does have an effect on the diversification dynamics, because the subclade is not subjected to the diversity dependence of the main clade. Hence, there is no diversity-dependent extension of eq. (D1);

  • the conditioning probabilities Inline graphic, Inline graphic, and Inline graphic, see eqs. (15), (16), and (17) of the main text; see also Etienne and Haegeman (2012), where explicit expressions are presented for the diversity-dependent analog of eq. (15);

  • the likelihood for multiple rate shifts, that is, eqs. (C10) and (C11) for the case of two rate shifts in the main clade. In fact, while the explicit formulas are cumbersome for multiple rate shifts, the framework of Etienne et al. (2012) with the vector Inline graphic can easily incorporate an arbitrary number of rate shifts and can be used to numerically evaluate the multiple-shifts likelihood. This has been implemented in version 4.3 in the R package DDD (Etienne and Haegeman 2020).

References

  1. Alfaro M.E., Santini F., Brock C., Alamillo H., Dornburg A., Rabosky D.L., Carnevale G., Harmon L.J.. 2009. Nine exceptional radiations plus high turnover explain species diversity in jawed vertebrates. Proc. Natl. Acad. Sci. USA 106:13410–13414. [DOI] [PMC free article] [PubMed] [Google Scholar]
  2. Barido-Sottani J., Vaughan T.G., Stadler T.. 2020. A multitype birth-death model for Bayesian inference of lineage-specific birth and death rates. Syst. Biol. 69:973–986. doi: 10.1093/sysbio/syaa016. [DOI] [PMC free article] [PubMed] [Google Scholar]
  3. Beaulieu J.M., O’Meara B.C.. 2016. Detecting hidden diversification shifts in models of trait-dependent speciation and extinction. Syst. Biol. 65:583–601. [DOI] [PubMed] [Google Scholar]
  4. Blount Z.D., Borland C.Z., Lenski R.E.. 2008. Historical contingency and the evolution of a key innovation in an experimental population of Escherichia coli. Proc. Natl. Acad. Sci. USA 105:7899–7906. [DOI] [PMC free article] [PubMed] [Google Scholar]
  5. Caetano D.S., O’Meara, B.C., Beaulieu J.M.. 2018. Hidden state models improve state-dependent diversification approaches, including biogeographical models. Evolution 72:2308–2324. [DOI] [PubMed] [Google Scholar]
  6. Chaves J.A., Weir J.T., Smith T.B.. 2011. Diversification in Adelomyia hummingbirds follows Andean uplift. Mol. Ecol. 20:4564–4576. [DOI] [PubMed] [Google Scholar]
  7. Etienne R.S., Haegeman B.. 2012. A conceptual and statistical framework for adaptive radiations with a key role for diversity dependence. Am. Nat. 180:E75–E89. [DOI] [PubMed] [Google Scholar]
  8. Etienne R.S., Haegeman B.. 2020. DDD: Diversity-Dependent Diversification. R package version 4.3. [DOI] [PMC free article] [PubMed]
  9. Etienne R.S., Haegeman B., Stadler T., Aze T., Pearson P.N., Purvis A., Phillimore A.B.. 2012. Diversity-dependence brings molecular phylogenies closer to agreement with the fossil record. Proc. R. Soc. B 279:1300–1309. [DOI] [PMC free article] [PubMed] [Google Scholar]
  10. Etienne R.S., Pigot A.L., Phillimore A.B.. 2016. How reliably can we infer diversity-dependent diversification from phylogenies? Methods Ecol. Evol. 7:1092–1099. [Google Scholar]
  11. FitzJohn R.G. 2010. Quantitative traits and diversification. Syst. Biol. 59:619–633. [DOI] [PubMed] [Google Scholar]
  12. FitzJohn R.G. 2012. Diversitree: comparative phylogenetic analyses of diversification in R. Methods Ecol. Evol. 3:1084–1092. [Google Scholar]
  13. Goldberg E.E., Igic B.. 2012. Tempo and mode in plant breeding system evolution. Evolution 66:3701–3709. [DOI] [PubMed] [Google Scholar]
  14. Goldberg E.E., Lancaster L.T., Ree R.H.. 2011. Phylogenetic inference of reciprocal effects between geographic range evolution and diversification. Syst. Biol. 60:451–465. [DOI] [PubMed] [Google Scholar]
  15. Heard S.B., Hauser D.L.. 1995. Key evolutionary innovations and their ecological mechanisms. Hist. Biol. 10:151–173. [Google Scholar]
  16. Herrera-Alsina L., van Els P., Etienne R.S.. 2018. Detecting the dependence of diversification on multiple traits from phylogenetic trees and trait data. Syst. Biol. 68:317–328. [DOI] [PubMed] [Google Scholar]
  17. Hoehna S., Freyman W.A., Nolen Z., Huelsenbeck J.P., May M.R., Moore B.R.. 2019. A Bayesian approach for estimating branch-specific speciation and extinction rates. bioRxiv 555805. [Google Scholar]
  18. Hua X., Bromham L.. 2017. Darwinism for the genomic age: connecting mutation to diversification. Front. Genet. 8:12. [DOI] [PMC free article] [PubMed] [Google Scholar]
  19. Laudanno G., Haegeman B., Etienne R.S.. 2020. Additional analytical support for a new method to compute the likelihood of diversification models. Bull. Math. Biol. 82:22. [DOI] [PMC free article] [PubMed] [Google Scholar]
  20. Liem K.F. 1973. Evolutionary strategies and morphological innovations: cichlid pharyngeal jaws. Syst. Zool. 22:425–441. [Google Scholar]
  21. Louca S., Pennell M.W.. 2020. Extant timetrees are consistent with a myriad of diversification histories. Nature 580:502–505. [DOI] [PubMed] [Google Scholar]
  22. Maddison W.P., Midford P.E., Otto S.P.. 2007. Estimating a binary character’s effect on speciation and extinction. Syst. Biol. 56:701–710. [DOI] [PubMed] [Google Scholar]
  23. Mahler D.L., Revell L.J., Glor R.E., Losos J.B.. 2010. Ecological opportunity and the rate of morphological evolution in the diversification of Greater Antillean anoles. Evolution 64: 2731–2745. [DOI] [PubMed] [Google Scholar]
  24. Maliet O., Hartig F., Morlon H.. 2019. A model with many small shifts for estimating species-specific diversification rates. Nat. Ecol. Evol. 3:1086–1092. [DOI] [PubMed] [Google Scholar]
  25. May M.R., Moore B.R.. 2016. How well can we detect lineage-specific diversification-rate shifts? A simulation study of sequential AIC methods. Syst. Biol. 65:1076–1084. [DOI] [PMC free article] [PubMed] [Google Scholar]
  26. Mitter C., Farrell B., Wiegmann B.. 1988. The phylogenetic study of adaptive zones: has phytophagy promoted insect diversification? Am. Nat. 132:107–128. [Google Scholar]
  27. Moore B.R., Höhna S., May M.R., Rannala B., Huelsenbeck J.P.. 2016. Critically evaluating the theory and performance of Bayesian analysis of macroevolutionary mixtures. Proc. Natl. Acad. Sci. USA 113:9569–9574. [DOI] [PMC free article] [PubMed] [Google Scholar]
  28. Nee S., May R.M., Harvey P.H.. 1994. The reconstructed evolutionary process. Philos. Trans. R. Soc. B 344:305–311. [DOI] [PubMed] [Google Scholar]
  29. Rabosky D.L. 2014. Automatic detection of key innovations, rate shifts, and diversity-dependence on phylogenetic trees. PLoS One 9:e89543. [DOI] [PMC free article] [PubMed] [Google Scholar]
  30. Rabosky D.L., Mitchell J.S., Chang J.. 2017. Is BAMM flawed? Theoretical and practical concerns in the analysis of multi-rate diversification models. Syst. Biol. 66:477–498. [DOI] [PMC free article] [PubMed] [Google Scholar]
  31. Schluter D. 2000. The ecology of adaptive radiation. Oxford, UK: Oxford University Press. [Google Scholar]
  32. Simpson G.G. 1944. Tempo and mode in evolution. New York (NY): Columbia University Press. [Google Scholar]
  33. Simpson G.G. 1953. Major features of evolution. New York (NY): Columbia University Press. [Google Scholar]
  34. Stadler T. 2012. How can we improve accuracy of macroevolutionary rate estimates? Syst. Biol. 62:321–329. [DOI] [PubMed] [Google Scholar]
  35. Title P.O., Rabosky D.L.. 2019. Tip rates, phylogenies and diversification: what are we estimating, and how good are the estimates? Methods Ecol. Evol. 10:821–834. [Google Scholar]
  36. Weir J.T., Haddrath O., Robertson H.A., Colbourne R.M., Baker A.J.. 2016. Explosive ice age diversification of kiwi. Proc. Natl. Acad. Sci. USA 113:E5580–E5587. [DOI] [PMC free article] [PubMed] [Google Scholar]
  37. Wellborn G.A., Langerhans R.B.. 2015. Ecological opportunity and the adaptive diversification of lineages. Ecol. Evol. 5:176–195. [DOI] [PMC free article] [PubMed] [Google Scholar]
  38. Yoder J., Clancey E., Des Roches S., Eastman J., Gentry L., Godsoe W., Hagey T., Jochimsen D., Oswald B., Robertson J., et al. 2010. Ecological opportunity and the origin of adaptive radiations. J. Evol. Biol. 23:1581–1596. [DOI] [PubMed] [Google Scholar]

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

RESOURCES