phylox.generators.trees.beta_splitting_tree
Adapted from script provided by (a colleage of) Pengyu Liu which contains the code for Beta-splitting model (Aldous1996)
The beta-splitting model is a model for generating random binary trees. The model is parameterized by a parameter beta > 0 which determines the shape of the tree.
- phylox.generators.trees.beta_splitting_tree.simulate_beta_splitting(n, beta, seed=None)
Simulate a random binary tree with n leaves using the beta-splitting model.
- Parameters:
n – the number of leaves of the tree.
beta – the beta parameter of the beta-splitting model.
- Returns:
a random binary tree with n leaves using the beta-splitting model.
- Example:
>>> from phylox.generators.trees.beta_splitting_tree import simulate_beta_splitting >>> tree = simulate_beta_splitting(5, 1) >>> len(tree.leaves) 5