Learn R Programming

statGraph (version 0.5.1)

ghoshdastidar.test: Ghoshdastidar hypothesis testing for large random graphs.

Description

Given two lists of graphs generated by the inhomogeneous random graph model, ghoshdastidar.test tests if they were generated by the same parameters.

Usage

ghoshdastidar.test(G1, G2, maxBoot = 300, two.sample = FALSE)

Value

A list containing:

T

the value of the test.

p.value

the p-value of the test (only returned when the parameter 'two.sample' is FALSE).

Arguments

G1

the first list of undirected graphs to be compared. Must be a list of matrices or igraph objects.

G2

the second list of undirected graphs to be compared. Must be a list of matrices or igraph objects.

maxBoot

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

two.sample

logical. If TRUE the sets contain only one graph each. If FALSE the sets contain more than one graph each (default is FALSE).

References

Ghoshdastidar, Debarghya, et al. "Two-sample tests for large random graphs using network statistics". arXiv preprint arXiv:1705.06168 (2017).

Ghoshdastidar, Debarghya, et al. "Two-sample hypothesis testing for inhomogeneous random graphs". arXiv preprint, arXiv:1707.00833 (2017).

Examples

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

## test for sets with more than one graph each under H0
G1 <- G2 <- list()
for(i in 1:10){
  G1[[i]] <- as.matrix(igraph::get.adjacency(igraph::sample_gnp(50,0.6)))
  G2[[i]] <- as.matrix(igraph::get.adjacency(igraph::sample_gnp(50,0.6)))
}
D1 <- ghoshdastidar.test(G1, G2)
D1

## test for sets with more than one graph each under H1
G1 <- G2 <- list()
for(i in 1:10){
  G1[[i]] <- as.matrix(igraph::get.adjacency(igraph::sample_gnp(50,0.6)))
  G2[[i]] <- as.matrix(igraph::get.adjacency(igraph::sample_gnp(50,0.7)))
}
D2 <- ghoshdastidar.test(G1, G2)
D2

## test for sets with only one graph each under H0
G1 <- G2 <- list()
G1[[1]] <- igraph::sample_gnp(300, 0.6)
G2[[1]] <- igraph::sample_gnp(300, 0.6)
D3 <- ghoshdastidar.test(G1, G2, two.sample= TRUE)
D3

## test for sets with only one graph each under H1
G1 <- G2 <- list()
G1[[1]] <- igraph::sample_gnp(300, 0.6)
G2[[1]] <- igraph::sample_gnp(300, 0.7)
D4 <- ghoshdastidar.test(G1, G2, two.sample= TRUE)
D4
}

Run the code above in your browser using DataLab