Description Usage Arguments Details Value References Examples
Using ratios-of-eigenvectors to detect underlying communities.
1 |
G |
A 0/1 adjacency matrix. |
K |
A positive integer, indictaing the number of underlying communities in graph |
itermax |
|
startn |
|
SCORE is fully established in Fast community detection by SCORE of Jin (2015). SCORE uses the entry-wise ratios between the first leading eigenvector and each of the other leading eigenvectors for clustering.
A label vector.
Jin, J. (2015) Fast community detection by score,
The Annals of Statistics 43 (1),
57–89
https://projecteuclid.org/euclid.aos/1416322036
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | set.seed(2020)
n = 10; K = 2
P = matrix(c(1/2, 1/4, 1/4, 1/2), byrow = TRUE, nrow = K)
distribution = c(1, 2)
l = sample(distribution, n, replace=TRUE, prob = c(1/2, 1/2))
Pi = matrix(0, n, 2)
for (i in 1:n){
Pi[i, l[i]] = 1
}
### define the expectation of the parent graph's adjacency matrix
Omega = Pi %*% P %*% t(Pi)
### construct the parent graph G
G = matrix(runif(n*n, 0, 1), nrow = n)
G = G - Omega
temp = G
G[which(temp >0)] = 0
G[which(temp <=0)] = 1
diag(G) = 0
G[lower.tri(G)] = t(G)[lower.tri(G)]
SCORE(G, 2)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.