adjacency_mat {gasper}R Documentation

Compute the Adjacency Matrix of a Gaussian Weighted Graph

Description

adjacency_mat calculates the adjacency matrix of a Gaussian weighted graph based on the distance between points in \mathbb{R}^3.

Usage

adjacency_mat(
  pts,
  f = function(x) {
     exp(-x^2/8)
 },
  s = 0
)

Arguments

pts

Matrix representing the coordinates of N points in \mathbb{R}^3. Each row should correspond to a point.

f

A scalar potential function. By default, the Gaussian potential \exp(-x^2/8) is used.

s

Numeric threshold used to sparsify the adjacency matrix. Any value below this threshold will be set to zero. Default is 0.

Details

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.

Value

A matrix representing the adjacency matrix of the Gaussian weighted graph.

See Also

laplacian_mat for calculating the Laplacian matrix, swissroll for generating a Swiss roll dataset.

Examples

pts <- swissroll(N=100, seed=0, a=1, b=4)
W <- adjacency_mat(pts)

[Package gasper version 1.1.6 Index]