Learn R Programming

CollessLike (version 2.0)

a.g.model: Generates a random tree

Description

Given alpha, gamma and the number of leaves n, generates a random phylogenetic tree between all trees with n leaves following the alpha-gamma model.

Usage

a.g.model(n, alpha, gamma)

Arguments

n

the number of leaves in the tree.

alpha

parametrer of the alpha-gamma model, between 0 and 1.

gamma

parametrer of the alpha-gamma model, between 0 and alpha.

Value

An igraph object that represents the generated phylogenetic tree.

References

B. Chen, D. Ford, M. Winkel, A new family of Markov branching trees: the alpha-gamma model. Electr. J. Probab. 14 (2009), 400-430.

Examples

Run this code
# NOT RUN {
 

# A phylogenetic tree with 10 leaves and parameters alpha=0.8 and gamma=0.1
# }
# NOT RUN {
tree = a.g.model(10,0.8,0.1)
# }
# NOT RUN {
plot(tree,layout=layout.reingold.tilford(tree,root=which(degree(tree,mode="in")==0)))
# }
# NOT RUN {
 
# }

Run the code above in your browser using DataLab