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
Run the code above in your browser using DataLab