Skip to contents

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

Usage

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

Arguments

d

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.

indices

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

...

Extra parameters specific to some statistics.

edge_count_prep

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

Value

A scalar giving the value of the desired test statistic.

Details

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.

Examples

n1 <- 30L
n2 <- 10L
gnp_params <- list(n = 24L, p = 1/3)
degree_params <- list(out_degree = rep(2, 24L), method = "configuration")
x <- nvd(sample_size = n1, model = "gnp", !!!gnp_params)
#>  Calling the `tidygraph::play_gnp()` function with the following arguments:
#> • n: 24
#> • p: 0.333333333333333
#> • directed: TRUE
#> • loops: FALSE
y <- nvd(sample_size = n2, model = "degree", !!!degree_params)
#>  Calling the `tidygraph::play_degree()` function with the following arguments:
#> • out_degree: 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, …, 2, and 2
#> • method: configuration
#> • in_degree: NULL
r <- repr_nvd(x, y, representation = "laplacian")
stat_student_euclidean(r, 1:n1)
#> [1] 5.790399
stat_welch_euclidean(r, 1:n1)
#> [1] 8.347264
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] 9.701484
stat_generalized_edge_count(d, 1:n1, edge_count_prep = ecp)
#> [1] 218.3131
stat_weighted_edge_count(d, 1:n1, edge_count_prep = ecp)
#> [1] 14.7707