Description Usage Arguments Value References Examples
Given two lists of graphs generated by the inhomogeneous random graph model,
ghoshdastidar.test
tests if they were generated by the same parameters.
1 | ghoshdastidar.test(G1, G2, maxBoot = 300, two.sample = FALSE)
|
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). |
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). |
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).
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.