indices.simulation: Generates random trees and compute their balance indices

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/indices.simulation.R

Description

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.

Usage

1
2
indices.simulation(n, alpha = NA, gamma = NA, repetitions = 1000,
  norm = FALSE)

Arguments

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.

Details

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:

Value

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).

Author(s)

Lucia Rotger

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.

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.

See Also

balance.indices

Examples

 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
 

LuciaRG/CollessLike documentation built on Oct. 12, 2019, 11:19 a.m.