View source: R/adjacency_mat.R
| adjacency_mat | R Documentation |
adjacency_mat calculates the adjacency matrix of a Gaussian weighted graph based on the distance between points in \mathbb{R}^3.
adjacency_mat(
pts,
f = function(x) {
exp(-x^2/8)
},
s = 0
)
pts |
Matrix representing the coordinates of N points in |
f |
A scalar potential function. By default, the Gaussian potential |
s |
Numeric threshold used to sparsify the adjacency matrix. Any value below this threshold will be set to zero. Default is 0. |
The function computes pairwise distances between each point in pts and weights the adjacency matrix based on the scalar potential f. The final adjacency matrix can be sparsified by setting values below the threshold s to zero.
A matrix representing the adjacency matrix of the Gaussian weighted graph.
laplacian_mat for calculating the Laplacian matrix,
swissroll for generating a Swiss roll dataset.
pts <- swissroll(N=100, seed=0, a=1, b=4)
W <- adjacency_mat(pts)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.