Description Usage Arguments Value References Examples
Given two independent finite-dimensional random dot product graphs,
tang.test
tests if they have generating latent positions that are drawn
from the same distribution.
1 |
G1 |
the first undirected graph to be compared. Must be an igraph object. |
G2 |
the second undirected graph to be compared. Must be an igraph object. |
dim |
dimension of the adjacency spectral embedding. |
sigma |
a real value indicating the kernel bandwidth. If NULL (default) the bandwidth is calculated by the method. |
maxBoot |
integer indicating the number of bootstrap resamples (default is 200). |
A list containing:
T |
the value of the test. |
p.value |
the p-value of the test. |
Tang, Minh, et al. "A nonparametric two-sample hypothesis testing problem for random graphs." Bernoulli 23.3 (2017): 1599-1630.
Tang, Minh, et al. "A semiparametric two-sample hypothesis testing problem for random graphs." Journal of Computational and Graphical Statistics 26.2 (2017): 344-354.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | set.seed(42)
## test under H0
lpvs <- matrix(rnorm(200), 20, 10)
lpvs <- apply(lpvs, 2, function(x) { return (abs(x)/sqrt(sum(x^2))) })
G1 <- igraph::sample_dot_product(lpvs)
G2 <- igraph::sample_dot_product(lpvs)
D1 <- tang.test(G1, G2, 5)
D1
## test under H1
lpvs2 <- matrix(pnorm(200), 20, 10)
lpvs2 <- apply(lpvs2, 2, function(x) { return (abs(x)/sqrt(sum(x^2))) })
G2 <- suppressWarnings(igraph::sample_dot_product(lpvs2))
D2 <- tang.test(G1, G2, 5)
D2
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.