nd_dsd function

Discrete Spectral Distance

Discrete Spectral Distance

Discrete Spectral Distance (DSD) is defined as the Euclidean distance between the spectra of various matrices, such as adjacency matrix AA("Adj"), (unnormalized) Laplacian matrix L=DAL=D-A("Lap"), signless Laplacian matrix L=D+A|L|=D+A("SLap"), or normalized Laplacian matrix L~=D1/2LD1/2\tilde{L}=D^{-1/2}LD^{-1/2}.

nd.dsd(A, out.dist = TRUE, type = c("Lap", "SLap", "NLap", "Adj"))

Arguments

  • A: a list of length NN containing (M×M)(M\times M) adjacency matrices.
  • out.dist: a logical; TRUE for computed distance matrix as a dist object.
  • type: type of target structure. One of "Lap","SLap","NLap","Adj" as defined above.

Returns

a named list containing

  • D: an (N×N)(N\times N) matrix or dist object containing pairwise distance measures.
  • spectra: an (N×M1)(N\times M-1) matrix where each row is top-M1M-1 vibrational spectra.

Examples

## load example data and extract only a few data(graph20) gr.small = graph20[c(1:5,11:15)] ## compute distance matrix output <- nd.dsd(gr.small, out.dist=FALSE) ## visualize opar <- par(no.readonly=TRUE) par(pty="s") image(output$D[,10:1], main="two group case", axes=FALSE, col=gray(0:32/32)) par(opar)

References

Rdpack::insert_ref(key="wilson_study_2008",package="NetworkDistance")

  • Maintainer: Kisung You
  • License: MIT + file LICENSE
  • Last published: 2021-08-21

Useful links