This is a collection of functions that provide statistics for testing equality in distribution between samples of networks.

stat_student_euclidean(d, indices, ...)

stat_welch_euclidean(d, indices, ...)

stat_original_edge_count(d, indices, edge_count_prep, ...)

stat_generalized_edge_count(d, indices, edge_count_prep, ...)

stat_weighted_edge_count(d, indices, edge_count_prep, ...)



Either a matrix of dimension \((n1+n2)x(n1+n2)\) containing the distances between all the elements of the two samples put together (for distance-based statistics) or the concatenation of the lists of matrix representations of networks in samples 1 and 2 for Euclidean t-Statistics.


A vector of dimension \(n1\) containing the indices of the elements of the first sample.


Extra parameters specific to some statistics.


A list of preprocessed data information used by edge count statistics and produced by edge_count_global_variables.


A scalar giving the value of the desired test statistic.


In details, there are three main categories of statistics:

  • Euclidean t-Statistics: both Student stat_student_euclidean version for equal variances and Welch stat_welch_euclidean version for unequal variances,

  • Statistics based on similarity graphs: 3 types of edge count statistics.


n1 <- 30L
n2 <- 10L
gnp_params <- list(p = 1/3)
k_regular_params <- list(k = 8L)
x <- nvd(model = "gnp", n = n1, model_params = gnp_params)
y <- nvd(model = "k_regular", n = n2, model_params = k_regular_params)
r <- repr_nvd(x, y, representation = "laplacian")
stat_student_euclidean(r, 1:n1)
#> [1] 0.8055932
stat_welch_euclidean(r, 1:n1)
#> [1] 0.9542853
d <- dist_nvd(x, y, representation = "laplacian", distance = "frobenius")
ecp <- edge_count_global_variables(d, n1, k = 5L)
stat_original_edge_count(d, 1:n1, edge_count_prep = ecp)
#> [1] -5.644431
stat_generalized_edge_count(d, 1:n1, edge_count_prep = ecp)
#> [1] 37.37713
stat_weighted_edge_count(d, 1:n1, edge_count_prep = ecp)
#> [1] -0.3640767