View source: R/PerturbedLaplacian.R
PerturbedLaplacian | R Documentation |
Construct and use the Perturbed Laplacian
PerturbedLaplacian(A, tau = NULL) ## S4 method for signature 'PerturbedLaplacian,sparseMatrix' transform(iform, A) ## S4 method for signature 'PerturbedLaplacian,sparseLRMatrix' inverse_transform(iform, A)
A |
A matrix to transform. |
tau |
Additive regularizer for row and column sums of |
iform |
An Invertiform object describing the transformation. |
We define the perturbed Laplacian L_tau(A) of an n by n graph adjacency matrix A as
L[ij] = (A[ij] + τ / n) / (sqrt(d^out[i] + τ) sqrt(d^in[j] + τ))
where
d^out[i] = sum_j abs(A[ij])
and
d^in[j] = sum_i abs(A[ij]).
When A[ij] denotes the present of an edge from node i to node j, which is fairly standard notation, d^out[i] denotes the (absolute) out-degree of node i and d^in[j] denotes the (absolute) in-degree of node j.
Note that this documentation renders more clearly at https://rohelab.github.io/invertiforms/.
PerturbedLaplacian()
creates a PerturbedLaplacian object.
transform()
returns the transformed matrix,
typically as a Matrix.
inverse_transform()
returns the inverse transformed matrix,
typically as a Matrix.
library(igraph) library(igraphdata) data("karate", package = "igraphdata") A <- get.adjacency(karate) iform <- PerturbedLaplacian(A) L <- transform(iform, A) L ## Not run: A_recovered <- inverse_transform(iform, L) all.equal(A, A_recovered) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.