SCORE: Spectral Clustering On Ratios-of-Eigenvectors.

Description Usage Arguments Details Value References Examples

View source: R/SCORE.R

Description

Using ratios-of-eigenvectors to detect underlying communities.

Usage

1
SCORE(G, K, itermax = NULL, startn = NULL)

Arguments

G

A 0/1 adjacency matrix.

K

A positive integer, indictaing the number of underlying communities in graph G.

itermax

k-means parameter, indicating the maximum number of iterations allowed. The default value is 100.

startn

k-means parameter. If centers is a number, how many random sets should be chosen? The default value is 10.

Details

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.

Value

A label vector.

References

Jin, J. (2015) Fast community detection by score, The Annals of Statistics 43 (1), 57–89
https://projecteuclid.org/euclid.aos/1416322036

Examples

 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)

GMPro documentation built on July 1, 2020, 6:05 p.m.

Related to SCORE in GMPro...