# Tree simulations and randomizations

Various packages in Mesquite can simulate or randomize trees, allowing you to build statistical tests based on null distributions or trees generated under some hypothesis.#### Contents

- Using results of simulations & randomizations
- Evolutionary Simulations of Trees
- Random Trees
- Randomized Trees

### Using results of simulations & randomizations

The simulated or randomized trees can be used or stored in several ways:- The trees can be stored into tree blocks in the current file by choosing options in the Make New Trees Block from submenu of the Taxa&Trees menu.
- The trees may be used directly, at that moment, in calculations. For example, if you make a Bar & Line Chart for trees, and choose Simulated Trees as your source of trees, the trees will be simulated and used in the chart without being stored in the file.
- A series of many files can be saved, each one with a different replicate of a block of simulated or randomized trees. This is available through the Save Copies of Tree Blocks submenu of the Taxa&Trees menu

### Evolutionary Simulations of Trees

#### Species Trees

We recommend you see the page on diversification for more features related to species tree evolution.- Uniform speciation (Yule) (trees package) — Generates tree by simple uniform probability speciation (a Yule process). The chance of speciation is equal for all tips. Options: total time depth of tree.
- Uniform speciation with sampling (TreeFarm package) — Generates a tree by Yule process, as above, but with to a total number of species greather than in the taxa block. Extra species are then randomly sampled out, to leave the tree with the appropriate number of species. Barraclough & Nee (2001) discuss how this sampling alters the branch length distribution of the tree.
- Birth/Death trees (Diverse package) — Simulates a constant rate of speciation and extinction to generate a tree. For more details see the page on diversification.
- Trees depending on the evolution of a character — in the Diverse package are also some simulators that evolve a tree and character simultaneously; the speciation and extinction rates may depend on the state of the character.

#### Gene Trees

- Coalescent Trees (coalesce package) - Generates tree by coalescence within a single panmictic population. Options: Effective population size.
- Coalescence Contained within Current Tree (coalesce package) - Generates tree by a simple coalescence model of a neutral gene with constant population size, within a current species tree from a Tree window or other tree context. Branch lengths are assigned according to generation of coalescence. The species tree used is a current tree found in a Tree Window or other tree context.

### Random Trees

- Equiprobable Trees (trees package)- Generates trees randomly so that each possible labelled tree topology is equally likely.
- Randomly Resolve Polytomies (TreeFarm package) - Randomly resolves polytomies in tree. All possible resolutions are equiprobable. Thus, if the tree is a polytomous bush, the resulting resolved trees will be distributed equivalently to that from the Equiprobable Trees module.

### Randomized Trees

- Reshuffle Terminal Taxa (TreeFarm package) - Shuffles (permutes) the taxa among the terminal nodes.
- Random Branch Moves (TreeFarm packages) — Performs a specified number of randomly -chosen branch moves.
- Add Noise to Branch Lengths (TreeFarm package) - Adds noise to branch lengths of tree. Noise is Normally distributed with variance specified by user. Optionally, this variance is proportional to current branch length. Negative branch lengths are not allowed, and are changed to zero. Options: variance of noise.
- Rarefy Tree (TreeFarm package) - Rarefies tree by randomly deleting taxa. Options: how many excluded.
- Augment Tree Randomly (TreeFarm package) - Augments tree by random placement of excluded taxa. Options: whether branch lengths are to be considered; whether addition is only to original branches