| scgExtra {igraph} | R Documentation |
Some useful functions to perform general actions in Spectral Coarse Graining (SCG).
scgNormEps(V, groups, mtype = c("symmetric", "laplacian",
"stochastic"), p = NULL, norm = c("row", "col"))
V |
A numeric matrix of (eigen)vectors assumed normalized.
The vectors are to be stored column-wise in |
groups |
A vector of |
mtype |
The type of semi-projector used for the SCG. For now “symmetric”, “laplacian” and “stochastic” are available. |
p |
A probability vector of length |
norm |
Either “row” or “col”. If set to “row” the rows of the Laplacian matrix sum to zero and the rows of the stochastic matrix sum to one; otherwise it is the columns. |
scgNormEps computes |v[i]-Pv[i]|,
where v[i] is the ith eigenvector in V and
P is the projector corresponding to the mtype argument.
normEps returns with a numeric vector whose ith component is
|v[i]-Pv[i]| (see Details).
David Morton de Lachapelle, http://people.epfl.ch/david.morton.
D. Morton de Lachapelle, D. Gfeller, and P. De Los Rios, Shrinking Matrices while Preserving their Eigenpairs with Application to the Spectral Coarse Graining of Graphs. Submitted to SIAM Journal on Matrix Analysis and Applications, 2008. http://people.epfl.ch/david.morton
v <- rexp(20) km <- kmeans(v,5) sum(km$withinss) scgNormEps(cbind(v), km$cluster)^2