Taxa, Trees, Characters ˇ

 

Diversification: Speciation and extinction

The diversification processes that determine the branching pattern of the phylogenetic tree, speciation and extinction, can be simulated and analyzed. There is a series of example files available showing some of these features.

Simulations

Trees can be created through simulations of speciation and extinction. Here are options:


Lineages through Time

You can display a lineages through time plot of the current tree in the tree window by selecting the (Tree Window)Analysis:Tree>Lineages through Time menu item.

Analysis: Speciation/Extinction rates (Independent of character)

This analysis assumes that speciation and extinction rates are constant (they do not depend on any character). The calculation is available in the Analysis:Tree menu of a tree window, under Diversification (Char. Indep.). The calculation is also available anywhere that a value for a tree can be calculated, for instance in the Tree Legend of the tree window (under Analysis:Tree), in the List of Trees (Columns>Number For Tree>), and in a Trees chart.

Analysis: A binary character's effect on diversification

These analyses explore whether there is an association between the states of a characters, and the rates of speciation and extinction. These analyseis are available in the Analysis:Tree menu of a tree window, under Character-Associated Diversification. They are also anywhere that a value for a tree can be calculated, for instance in the tree legend of the tree window (Analysis:Tree>Tree Legend>Tree Value Using Character, Show secondary choices), in the List of Trees (Columns>Number for Tree>Tree Value Using Character, Show secondary choices), and in charts of trees. They are also available in the List of Characters window (Columns>Number For Character>Character Value with Current Tree, Show secondary choices) and in charts of characters.

The BiSSE likelihood calculations

The Diverse package's BiSSE calculations are based on the equations of Maddison, Midford & Otto (2007). The maximum likelihood calculations are performed using the optimizer of Brent (1973). To improve the performance of the optimizer, the BiSSE module invokes the optimizer from 10 randomly selected starting points. During these runs, the numerical integrator (see below) is set to run with a relatively large starting step size equal to 1/100 the length of an average branch. This length is value is allowed to vary somewhat (a range of 8:1) with the length of the particular branch, so that extremely short branches and long branches are not undercounted or overcounted respectively. The final likelihood value is then calculated using the starting point with the best likelihood, but a smaller step size (1/1000) the average branch length.
The BiSSE method requires numerical solution of a system of four differential equations along each branch of the tree. To do this, Diverse uses a RKF45 (Runge-Kutta-Fehlenberg fourth order method with fifth order step-size control) algorithm to integrate along the branches. The step-size control allows the step size to vary from the starting value based on the correction calculation. Because BiSSE equations are relatively well behaved, using a higher order correction mostly serves to speed the calculation by allowing the method to grow the step size. Note that this method is a refinement of the RK4 algorithm used in Maddison, Midford & Otto (2007).

Hypothesis Testing

To test hypotheses about the association between a character and diversification rates, you can use either the Sister Diversification calculation, which directly gives a P value, or the BiSSE Ln Likelihood Difference calculation, which can be used to get a p value. The former is an old but fairly non-parametric calculation; the latter is parametric but uses more of the information in the tree.
The BiSSE Ln Likelihood Difference calculation is used for likelihood ratio tests. It performing the calculations in constrained and unconstrained ways and calculating the difference in likelihood. You can access these calculations as a choice when you do the Character-Associated Diversification analysis in the Analysis:Tree menu of the Tree window, or in other places (such as charts) where you are calculating a value for a tree and character. You will be asked first to specify the parameters of the unconstrained model, then the parameters of the constrained model.
The likelihood difference can be used to answer whether, for instance, two parameter values are the same. Thus, the constrained model would set them equal (using the "Constrain =" choices in the dialog), while the unconstrained model would not include this constraint. When there is a difference of a single degree of freedom in the constrained and unconstrained models (i.e. comparing a five parameter and a 6 parameter model) then two times the likelihood difference appears to be approximately distributed as a chi square (Maddison, Midford & Otto 2007), so that you can use that distribution for significance values.
It is more accurate, but more time consuming, to simulate under the null model to derive your own distribution for statistical testing. You can do this as follows.
  1. With your data, estimate the values of the BiSSE parameters in the constrained case (e.g., lambda0 = lambda1).
  2. Simulate trees and characters using Trees & Diversification Characters in the Taxa&Trees menu, choosing the BiSSE Trees & Characters as the simulator. Enter the parameters as you had estimated them from your data. Choose as many taxa as in your data. You might want to simulate a small number of trees, e.g. 5, at first, just to practice with these calculations. (Later increase the sample size to a large number, e.g. 1000, to derive a good distribution.)
  3. Save the file (just in case).
  4. Choose New Bar & Line Chart for... Characters. You will be asked a series of question. Here are the responses:
    • If asked, choose Stored Characters for Source of Characters. If given a choice, make sure you choose the matrix you just simulated with BiSSE Trees & Characters.
    • Value (under secondary choices): Character value with Respective Tree
    • Source of trees: Stored trees. If given a choice, make sure you choose the trees you just simulated with BiSSE Tree & Characters.
    • Value: BiSSE Ln likelihood difference
    • BiSSE Parameters: Leave the parameters unspecified, but set the constraints to be as in your UNCONSTRAINED model.
    • BiSSE Parameters: Leave the parameters unspecified, but set the constraints to be as in your CONSTRAINED model.

  1. This calculation may take a long time. If asked, indicate you want to save a table of results. Also, print the chart and save it as text once it's done. You might not want to redo it (as it takes a while).

Multiple Trees

You can examine likelihoods, or other single parameters from the BiSSE modules, over multiple trees by asking for a tree chart and indicating you want a Tree Value using Character. You will be asked if you want to save the results as a table to a text file during the calculations; this text file will contain all of the parameter values as well, as a tab-delimited table, so that you can import it into a spreadsheet program.
You can also examine multiple trees by setting up the tree window and selecting Character-Associated Diversification in the Analysis:Tree menu to begin a BiSSE calculation. Then, you can paste the following script into the Send Script dialog box (available in the Tree window's Window menu, Scripting submenu). This script will go from tree to tree, saving results as it goes.
String.resultsFile 'results.txt'; saveMessageToFile *String.resultsFile 'RESULTS with different trees'; appendReturnToFile *String.resultsFile; getWindow; tell It; getNumTrees; Integer.numReps *It; ifNotCombinable *Integer.numReps; Integer.numReps 10; [in case indefinite number of trees] endIf; endTell; debug; Integer.count 0; for *Integer.numReps; increment.count; getWindow; tell It; setTreeNumber *Integer.count; endTell; getEmployee #mesquite.diverse.CharAssocDivViewer.CharAssocDivViewer; tell It; doCounts; [because counts dont auto-update when scripting] endTell; getEmployee #mesquite.diverse.BiSSELikelihood.BiSSELikelihood; tell It; getLastResult; String.result *It; appendMessageToFile *String.resultsFile *String.result; appendReturnToFile *String.resultsFile; endTell; endFor;

References

Brent, R. P. 1973. Algorithms for Optimization without Derivatives. Englewood Cliffs, New Jersey. Prentice Hall.
Maddison, W.P., P.E. Midford & S.P. Otto. 2007. Estimating a binary character's effect on speciation and extinction. Systematic Biology 56:701-710.
Mitter, C. , B. Farrell, and B. Wiegmann. 1988. The phylogenetic study of adaptive zones: has phytophagy promoted insect diversification? American Naturalist 132:107–128.