localize_sgwt: Localize a Kernel at a Specific Vertex using SGWT

View source: R/localize_sgwt.R

localize_sgwtR Documentation

Localize a Kernel at a Specific Vertex using SGWT

Description

This function localizes a kernel at a specific vertex using the Spectral Graph Wavelet Transform (SGWT).

Usage

localize_sgwt(i, evalues, evectors, b = 2)

Arguments

i

Integer index of the node where to localize the kernel.

evalues

Numeric vector of the eigenvalues of the Laplacian matrix.

evectors

Numeric matrix of the eigenvectors of the Laplacian matrix.

b

Numeric scalar that controls the number of scales in the SGWT. It must be greater than 1.

Details

The SGWT offers a comprehensive understanding of graph signals by providing insights into both vertex (spatial) and spectral (frequency) domains.

The kernel is localized by transforming an impulse signal centered at vertex i using the SGWT. The SGWT leverages a wavelet function \psi(\lambda) to provide a multi-resolution analysis of the graph signal. The impulse signal at vertex i is a vector s with a one at the i-th position and zeros elsewhere. The SGWT is given by:

W_s(\lambda) = s \ast \psi(\lambda) = U \psi(\Lambda) U^T s

where U is the matrix of eigenvectors of the Laplacian and \Lambda is the diagonal matrix of eigenvalues. The localized spatial view of the kernel's behavior around vertex i is achieved by transforming this impulse signal using the above expression.

To gain insights into the spectral localization of this localized kernel, one can analyze its GFT to understand how the energy of the kernel is distributed across various graph frequencies. As SGWT scales move from coarse to fine, energy concentration of the localized kernel shifts from lower to higher graph frequencies, indicating tighter spectral localization.

Value

s Kernel localized at vertex i using SGWT.

See Also

forward_sgwt, forward_gft, forward_gft

Examples

## Not run: 
# Compute the Laplacian matrix and its eigen-decomposition
L <- laplacian_mat(grid1$sA)
decomp <- eigensort(L)

# Randomly select a vertex
vertex_i <- sample(1:nrow(L), 1)

s_sgwt <- localize_sgwt(vertex_i, evalues=decomp$evalues, evectors=decomp$evectors, b=2)

# Select one scale j from s_sgwt.
N <- nrow(grid1$sA)
j <- 5 # change scale j to view other scales
s <- s_sgwt[ ((j-1)*N+1):(j*N)]

# Plot the localized kernel (for the chosen scale) as a signal on the graph
plot_signal(grid1, s)

# Plot the magnitude of the GFT coefficients
barplot(abs(s_gft), main="GFT of Localized Signal",
        xlab="Eigenvalue Index", ylab="Magnitude")

## End(Not run)

gasper documentation built on Oct. 27, 2023, 1:07 a.m.