Learn R Programming

GSD (version 1.0.0)

adjmatrix: Weighted Adjacency Matrix

Description

This function produces weighted adjacency matrix by Gaussian kernel.

Usage

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

Value

a sparse weighted adjacency matrix

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.

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. tools:::Rd_expr_doi("https://doi.org/10.1109/TSP.2017.2733489")

See Also

gsignal, gplot.

Examples

Run this code
## 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)

Run the code above in your browser using DataLab