Constructs a Gaussian kernel graph from a given feature space.

ConstructGaussianGraph(
  knn = 5,
  feature_space,
  alpha = 10,
  coef = 1,
  epsilon = 0.001,
  self_loop = 1
)

Arguments

knn

integer; the number of nearest neighbors to consider for each node. Default is 5.

feature_space

matrix; a cell-by-coordinate matrix (e.g., 20 principal components)

alpha

numeric; exponent used in the alpha-decaying Gaussian kernel

coef

numeric; coefficient for adaptive bandwidth. Default is 1.

epsilon

numeric; threshold below which edge weights are set to zero to sparsify the graph. Default is 1e-3.

self_loop

numeric; value for the diagonal elements of the affinity matrix to add self-loops. Default is 1.

Value

A list containing the following elements:

graph

A symmetric matrix representing the graph affinity matrix.

adj_matrix

A binary adjacency matrix indicating the presence of edges between nodes.