powerComp {poweRbal} | R Documentation |
Comparison of the power of TSS under different models
Description
powerComp
- Compare the power of a set of TSS to identify trees
generated under different alternative models given a null model.
powerComp_RegAcc
- Compare the power of a set of TSS to identify trees
generated under different alternative models given a the region(s) of
acceptance.
Usage
powerComp(
tss,
null_model = "yule",
alt_models,
n,
distribs = "exact_if_possible",
N_null = 10000L,
N_alt = 1000L,
test_type = "two-tailed",
correction = "small-sample",
sig_lvl = 0.05
)
powerComp_RegAcc(
tss,
accept_regions,
null_model,
alt_models,
n,
distribs = "exact_if_possible",
N_null = 10000L,
N_alt = 1000L,
test_type = "two-tailed",
correction = "small-sample",
sig_lvl = 0.05
)
Arguments
tss |
Vector containing the names (as character) of the tree shape
statistics that should be compared. You may either use the short names
provided in |
null_model |
The null model that is to be used to determine the power
of the tree shape statistics. In general, it must be a function that
produces rooted binary trees in |
alt_models |
List containing the alternative models that are to be
used to determine the power of the tree shape statistics. Functions that
produce rooted binary trees in |
n |
Integer value that specifies the desired number of leaves, i.e., vertices with in-degree 1 and out-degree 0. |
distribs |
Determines how the distributions (and with that the
bounds of the critical region) are computed. Available are:
|
N_null |
Sample size (integer >=10) if distributions are sampled (default = 10000L). |
N_alt |
Sample size (integer >=10) for the alternative models to estimate the power (default = 1000L). |
test_type |
Determines the method. Available are:
|
correction |
Specifies the desired correction method.
Available are:
|
sig_lvl |
Level of significance (default = 0.05, must be >0 and <1). |
accept_regions |
Numeric matrix (one row per TSS) with two or four
columns: The first two columns contain the interval limits of the region
of acceptance, i.e., we reject the null hypothesis for values strictly
outside of this interval. The third and fourth columns contain the
probabilities to reject the null hypothesis if values equal the lower or
upper bound, respectively. If the last two columns are missing they are
interpreted as zeroes. See return value of |
Value
powerComp
Returns an object of class 'poweRbal_data' which
is a list containing the following objects:
power: Numeric matrix containing the power values (one row per TSS and one column per alternative model).
accept_regions: Numeric matrix containing the information on the region of acceptance (one row per TSS and four columns).
CIradius: Numeric matrix containing the confidence interval radii (one row per TSS and one column per alternative model).
actual_sample_sizes: Numeric vector containing the actual sample sizes under each alternative model as some models do not always successfully generate trees.
other input data.
powerComp_RegAcc
Returns an object of class 'poweRbal_data'
similar to powerComp
.
References
S. J. Kersting, K. Wicke, and M. Fischer. Tree balance in phylogenetic models. arXiv:2406.05185, 2024.
Examples
powerComp(tss = c("Sackin", "Colless", "B1I"),
alt_models = list(list("aldous",-1), "pda", "etm"), n = 10L,
distribs = "sampled", N_null = 40L, N_alt = 20L)
powerComp_RegAcc(tss = c("Sackin", "Colless", "B1I"),
accept_regions = getAccRegion(tss = c("Sackin", "Colless", "B1I"),
n = 6L, null_model = "etm",
N_null = 20L, distribs = "sampled"),
null_model = "etm", distribs = "sampled",
alt_models = list(list("aldous",-1), "pda", "yule"), n = 6L,
N_null = 20L, N_alt = 20L)