Learn R Programming

statGraph (version 0.5.1)

cerqueira.test: Andressa Cerqueira, Daniel Fraiman, Claudia D. Vargas and Florencia Leonardi non-parametric test of hypotheses to verify if two samples of random graphs were originated from the same probability distribution.

Description

Given two identically independently distributed (idd) samples of graphs G1 and G2, the test verifies if they have the same distribution by calculating the mean distance D from G1 to G2. The test rejects the null hypothesis if D is greater than the (1-alpha)-quantile of the distribution of the test under the null hypothesis.

Usage

cerqueira.test(G1, G2, maxBoot = 300)

Value

A list containing:

W

the value of the test.

p.value

the p-value of the test.

Arguments

G1

the first iid sample of graphs to be compared. Must be a list of igraph objects.

G2

the second iid sample of graphs to be compared. Must be a list of igraph objects.

maxBoot

integer indicating the number of bootstrap resamples (default is 300).

References

Andressa Cerqueira, Daniel Fraiman, Claudia D. Vargas and Florencia Leonardi. "A test of hypotheses for random graph distributions built from EEG data", https://ieeexplore.ieee.org/document/7862892

Examples

Run this code
if (FALSE) {
set.seed(42)

## test under H0
G1 <- G2 <- list()
for(i in 1:10){
  G1[[i]] <- igraph::sample_gnp(50,0.5)
  G2[[i]] <- igraph::sample_gnp(50,0.5)
}
k1 <- cerqueira.test(G1, G2)
k1

## test under H1
G1 <- G2 <- list()
for(i in 1:10){
  G1[[i]] <- igraph::sample_gnp(50,0.5)
  G2[[i]] <- igraph::sample_gnp(50,0.6)
}
k2 <- cerqueira.test(G1, G2)
k2
}

Run the code above in your browser using DataLab