File: embed_laplacian_matrix.Rd

package info (click to toggle)
r-cran-igraph 2.1.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 27,044 kB
  • sloc: ansic: 204,981; cpp: 21,711; fortran: 4,090; yacc: 1,229; lex: 519; sh: 52; makefile: 8
file content (114 lines) | stat: -rw-r--r-- 4,735 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/embedding.R
\name{embed_laplacian_matrix}
\alias{embed_laplacian_matrix}
\title{Spectral Embedding of the Laplacian of a Graph}
\usage{
embed_laplacian_matrix(
  graph,
  no,
  weights = NULL,
  which = c("lm", "la", "sa"),
  type = c("default", "D-A", "DAD", "I-DAD", "OAP"),
  scaled = TRUE,
  options = arpack_defaults()
)
}
\arguments{
\item{graph}{The input graph, directed or undirected.}

\item{no}{An integer scalar. This value is the embedding dimension of the
spectral embedding. Should be smaller than the number of vertices. The
largest \code{no}-dimensional non-zero singular values are used for the
spectral embedding.}

\item{weights}{Optional positive weight vector for calculating a weighted
embedding. If the graph has a \code{weight} edge attribute, then this is
used by default. For weighted embedding, edge weights are used instead
of the binary adjacency matrix, and vertex strength (see
\code{\link[=strength]{strength()}}) is used instead of the degrees.}

\item{which}{Which eigenvalues (or singular values, for directed graphs) to
use. \sQuote{lm} means the ones with the largest magnitude, \sQuote{la} is
the ones (algebraic) largest, and \sQuote{sa} is the (algebraic) smallest
eigenvalues. The default is \sQuote{lm}. Note that for directed graphs
\sQuote{la} and \sQuote{lm} are the equivalent, because the singular values
are used for the ordering.}

\item{type}{The type of the Laplacian to use. Various definitions exist for
the Laplacian of a graph, and one can choose between them with this
argument.

Possible values: \code{D-A} means \eqn{D-A} where \eqn{D} is the degree
matrix and \eqn{A} is the adjacency matrix; \code{DAD} means
\eqn{D^{1/2}}{D^1/2} times \eqn{A} times \eqn{D^{1/2}{D^1/2}},
\eqn{D^{1/2}}{D^1/2} is the inverse of the square root of the degree matrix;
\code{I-DAD} means \eqn{I-D^{1/2}}{I-D^1/2}, where \eqn{I} is the identity
matrix.  \code{OAP} is \eqn{O^{1/2}AP^{1/2}}{O^1/2 A P^1/2}, where
\eqn{O^{1/2}}{O^1/2} is the inverse of the square root of the out-degree
matrix and \eqn{P^{1/2}}{P^1/2} is the same for the in-degree matrix.

\code{OAP} is not defined for undirected graphs, and is the only defined type
for directed graphs.

The default (i.e. type \code{default}) is to use \code{D-A} for undirected
graphs and \code{OAP} for directed graphs.}

\item{scaled}{Logical scalar, if \code{FALSE}, then \eqn{U} and \eqn{V} are
returned instead of \eqn{X} and \eqn{Y}.}

\item{options}{A named list containing the parameters for the SVD
computation algorithm in ARPACK. By default, the list of values is assigned
the values given by \code{\link[=arpack_defaults]{arpack_defaults()}}.}
}
\value{
A list containing with entries: \item{X}{Estimated latent positions,
an \code{n} times \code{no} matrix, \code{n} is the number of vertices.}
\item{Y}{\code{NULL} for undirected graphs, the second half of the latent
positions for directed graphs, an \code{n} times \code{no} matrix, \code{n}
is the number of vertices.} \item{D}{The eigenvalues (for undirected graphs)
or the singular values (for directed graphs) calculated by the algorithm.}
\item{options}{A named list, information about the underlying ARPACK
computation. See \code{\link[=arpack]{arpack()}} for the details.}
}
\description{
Spectral decomposition of Laplacian matrices of graphs.
}
\details{
This function computes a \code{no}-dimensional Euclidean representation of
the graph based on its Laplacian matrix, \eqn{L}. This representation is
computed via the singular value decomposition of the Laplacian matrix.

They are essentially doing the same as \code{\link[=embed_adjacency_matrix]{embed_adjacency_matrix()}},
but work on the Laplacian matrix, instead of the adjacency matrix.
}
\examples{

## 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_laplacian_matrix(RDP, 5)
}
\references{
Sussman, D.L., Tang, M., Fishkind, D.E., Priebe, C.E.  A
Consistent Adjacency Spectral Embedding for Stochastic Blockmodel Graphs,
\emph{Journal of the American Statistical Association}, Vol. 107(499), 2012
}
\seealso{
\code{\link[=embed_adjacency_matrix]{embed_adjacency_matrix()}},
\code{\link[=sample_dot_product]{sample_dot_product()}}

Other embedding: 
\code{\link{dim_select}()},
\code{\link{embed_adjacency_matrix}()}
}
\author{
Gabor Csardi \email{csardi.gabor@gmail.com}
}
\concept{embedding}
\keyword{graphs}
\section{Related documentation in the C library}{\href{https://igraph.org/c/html/latest/igraph-Embedding.html#igraph_laplacian_spectral_embedding}{\code{igraph_laplacian_spectral_embedding()}}.}