This function provides a Monte-Carlo estimate of the power of the permutation tests proposed in this package.
power2(
model1 = "gnp",
model2 = "k_regular",
n1 = 20L,
n2 = 20L,
num_vertices = 25L,
model1_params = NULL,
model2_params = NULL,
representation = "adjacency",
distance = "frobenius",
stats = c("flipr:t_ip", "flipr:f_ip"),
B = 1000L,
alpha = 0.05,
test = "exact",
k = 5L,
R = 1000L,
seed = 1234
)A numeric value estimating the power of the test.
A string specifying the model to be used for generating the
first sample. Choices are "sbm", "k_regular", "gnp", "smallworld",
"pa", "poisson" and "binomial". Defaults to "gnp".
A string specifying the model to be used for generating the
second sample. Choices are "sbm", "k_regular", "gnp", "smallworld",
"pa", "poisson" and "binomial". Defaults to "k_regular".
The size of the first sample. Defaults to 20L.
The size of the second sample. Defaults to 20L.
The number of nodes in the generated graphs. Defaults to
25L.
A named list setting the parameters of the first chosen
model. Defaults to list(p = 1/3).
A named list setting the parameters of the second chosen
model. Defaults to list(k = 8L).
A string specifying the desired type of representation,
among: "adjacency", "laplacian" and "modularity".
Defaults to "adjacency".
A string specifying the chosen distance for calculating the
test statistic, among: "hamming", "frobenius",
"spectral" and "root-euclidean". Defaults to
"frobenius".
A character vector specifying the chosen test statistic(s),
among: "original_edge_count", "generalized_edge_count",
"weighted_edge_count", "student_euclidean", "welch_euclidean" or any
statistics based on inter-point distances available in the flipr
package: "flipr:student_ip", "flipr:fisher_ip", "flipr:bg_ip",
"flipr:energy_ip", "flipr:cq_ip". Defaults to c("flipr:student_ip", "flipr:fisher_ip").
The number of permutation or the tolerance. If this number is lower
than 1, it is intended as a tolerance. Otherwise, it is intended as
the number of required permutations. Defaults to 1000L.
Significance level for hypothesis testing. Defaults to 0.05.
A character string specifying the formula to be used to compute
the permutation p-value. Choices are "estimate", "upper_bound" and
"exact". Defaults to "exact" which provides exact tests.
An integer specifying the density of the minimum spanning tree used
for the edge count statistics. Defaults to 5L.
Number of Monte-Carlo trials used to estimate the power. Defaults to
1000L.
An integer specifying the random generator seed. Defaults to `1234.
Currently, six scenarios of pairs of populations are implemented. Scenario 0 allows to make sure that all our permutation tests are exact.
gnp_params <- list(p = 1/3)
k_regular_params <- list(k = 8L)
power2(
model1_params = gnp_params,
model2_params = k_regular_params,
R = 10,
B = 100,
seed = 1234
)
Run the code above in your browser using DataLab