adjmatrix {GSD}R Documentation

Weighted Adjacency Matrix

Description

This function produces weighted adjacency matrix by Gaussian kernel.

Usage

adjmatrix(xy, method = c("dist", "neighbor"), alpha) 

Arguments

xy

matrix or data.frame containing vertex coordinate x, y.

method

When method="dist", edge weights are calculated by Gaussian kernel for connecting vertices within distance alpha. When method="neighbor", edge weights are calcaulated by Gaussian kernel for connecting alpha neighboring vertices.

alpha

specifies distance between vertices when method="dist", and the number of neighboring vertices when method="neighbor".

Details

This function produces a sparse weighted adjacency matrix by Gaussian kernel based on the distance between vertices.

Value

a sparse weighted adjacency matrix

References

Zeng, J., Cheung, G., and Ortega, A. (2017). Bipartite approximation for graph wavelet signal decomposition. IEEE Transactions on Signal Processing, 65(20), 5466–5480. doi:10.1109/TSP.2017.2733489

See Also

gsignal, gplot.

Examples

## define vertex coordinate
x <- y <- seq(0, 1, length=30)
xy <- expand.grid(x=x, y=y)

## weighted adjacency matrix by Gaussian kernel 
## for connecting vertices within distance 0.04
A1 <- adjmatrix(xy, method = "dist", 0.04) 

## weighted adjacency matrix by Gaussian kernel 
## for connecting seven neighboring vertices
A2 <- adjmatrix(xy, method="neighbor", 7)

[Package GSD version 1.0.0 Index]