embed_adjacency_matrix(graph, no, weights = NULL, which = c("lm", "la",
"sa"), scaled = TRUE, cvec = graph.strength(graph, weights =
weights)/(vcount(graph) - 1), options = igraph.arpack.default)
no
-dimensional non-zero singular values are used for the
spectral embedding.weight
edge attribute, then this is
used by default.FALSE
, then $U$ and $V$ are
returned instead of $X$ and $Y$.igraph.arpack.default
.n
times no
matrix, n
is the number of vertices.NULL
for undirected graphs, the second half of the latent
positions for directed graphs, an n
times no
matrix, n
is the number of vertices.arpack
for the details.no
-dimensional Euclidean representation of
the graph based on its adjacency matrix, $A$. This representation is
computed via the singular value decomposition of the adjacency matrix,
$A=UDV^T$.In the case, where the graph is a random dot product graph
generated using latent position vectors in $R^{no}$ for each vertex, the
embedding will provide an estimate of these latent vectors.For undirected graphs the latent positions are calculated as
$X=U^{no}D^{1/2}$, where $U^{no}$ equals
to the first no
columns of $U$, and $D^{1/2}$ is
a diagonal matrix containing the top no
singular values on the
diagonal.
For directed graphs the embedding is defined as the pair $X=U^{no}D^{1/2}$ and $Y=V^{no}D^{1/2}$. (For undirected graphs $U=V$, so it is enough to keep one of them.)
sample_dot_product
## A small graph
lpvs <- matrix(rnorm(200), 20, 10)
lpvs <- apply(lpvs, 2, function(x) { return (abs(x)/sqrt(sum(x^2))) })
RDP <- sample_dot_product(lpvs)
embed <- embed_adjacency_matrix(RDP, 5)
Run the code above in your browser using DataLab