Learn R Programming

FuzzySpec (version 1.0.0)

compute.sigma: Compute Locally-Adaptive Scaling Parameters from a Distance Matrix

Description

Derives pointwise scale parameters \(\sigma_i\) from a distance matrix, based on the \(r\)-th nearest neighbour distances. This is useful for constructing the adaptive similarity graphs proposed by Zelnik-Manor and Perona (2004).

Usage

compute.sigma(distance, r = NULL)

Value

A list with components:

sigma

A numeric vector of length \(n\), containing local scale parameters.

radius

The neighborhood radius \(r\) used.

Arguments

distance

An \(n \times n\) numeric (symmetric) distance matrix. Required.

r

Integer valued neighbourhood radius. If NULL, this value is estimated adaptively with find.radius.

Details

For each observation \(i\), the function sorts the distances distance[i, ], excludes the zero self-distance, and takes the \((r+1)\) smallest value, where \(\sigma_i\) reflects the distance to the \(r\)-th nearest neighbour for observation \(i\).

References

Ghashti, J. S., Hare, W., and J. R. J. Thompson (2025). Variable-weighted adjacency constructions for fuzzy spectral clustering. Submitted.

Zelnik-Manor, L. and P. Perona (2004). Self-tuning spectral clustering. Advances in Neural Information Processing Systems, 17.

See Also

make.adjacency, gen.fuzzy, plot.fuzzy, rNN.dist, find.radius, compute.SNN, fuzzy.spectral.clustering

Examples

Run this code
set.seed(1)
X <- matrix(rnorm(50), nrow = 10)
D <- as.matrix(dist(X))

res <- compute.sigma(D) # automatically determine r
res$sigma
res$radius

res2 <- compute.sigma(D, r = 3) # user-specified r
res2$sigma

Run the code above in your browser using DataLab