Description Usage Arguments Details Value Author(s) References See Also Examples
View source: R/indices.simulation.R
Generates a list of trees according to the introduced parameters for the alpha-gamma model. Then, this 3 balance index are calulated: Colless-like, Sackin and Cophenetic.
1 2 |
n |
the number of leaves of the tree. |
alpha |
parametrer of the alpha-gamma model, between 0 and 1. |
gamma |
parametrer of the alpha-gamma model, between 0 and alpha. |
repetitions |
the number of trees to generate. |
norm |
a logical object indicating if the indices should been normalized or not. |
Given a number of leaves, the function generates a tree with that number of leaves and computates the three indeces of balance (Colles-like, Sackin and Cophenetic with function balance.indices
). This is done as many times as it is set by 'repetitions' parameter, and it generates a 3-column data.frame of indices.
The trees are generated according to the alpha-gamma model. These parameters can be specified by alpha
and gamma
parameters of the function. The following cases are distinguished:
alpha = NA
and gamma = NA
: All the 66 combinations of alpha
in { 0, 0.1, 0.2, ... ,0.9, 1 } and gamma
in { 0, 0.1, ... ,alpha
} are done.
alpha
in [0,1] and gamma = NA
: Since alpha
is fixed, all the combinations with that alpha
and gamma
in { 0, 0.1, ... ,alpha
} are done.
alpha
in [0,1] and gamma
in [0,alpha
] : Both parameters are fixed. Then, only that combination is done.
A 3-column data.frame with the Colless-like, Sackin and Cophenetic balance indices for every generated tree. If more than one data.frame has to be generated, then the returned value is a data.frame list (its names specify which alpha and gamma parameters have generated that data.frame, for instance "a0.5g0.3" indicates alpha=0.5 and gamma=0.3).
Lucia Rotger
B. Chen, D. Ford, M. Winkel, A new family of Markov branching trees: the alpha-gamma model. Electr. J. Probab. 14 (2009), 400-430.
A. Mir, F. Rossello, L.Rotger, Sound Colless-like balance indices for multifurcating phylogenetic trees.PloS ONE 13 (2018), e0203401.
A. Mir, F. Rossello, L.Rotger, A new balance index for phylogenetic trees. Mathematical Biosciences 241 (2013), 125-136.
M. J. Sackin, "Good" and "bad" phenograms. Sys. Zool, 21 (1972), 225-226.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | #('Repetitions' set as 100 for a fast example)
indices.table = indices.simulation(5,0.5,0.3,repetitions=10)
head(indices.table)
#Normalized indices (between 0 and 1)
indices.table = indices.simulation(5,0.5,0.3,repetitions=10,norm=TRUE)
head(indices.table)
#Without specifying alpha and gamma
indices.list = indices.simulation(5,repetitions=100)
#by default alpha=seq(0,1,0.1) and gamma=seq(0,alpha,0.1), thus
length(indices.list) #=66
#all the elements of the list have a name that identifies its parameters
indices.list$a0.5g0.3
indices.list$a0.7g0.2
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.