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

Description Usage Arguments Value References Examples

View source: R/statGraph.R

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

1
ghoshdastidar.test(G1, G2, maxBoot = 300, two.sample = 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).

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

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
## Not run: 
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

## End(Not run)

statGraph documentation built on May 19, 2021, 9:11 a.m.