This function provides a method to construct the NNL.
Usage
nnl(distance, K)
Value
E
The edge matrix representing the similarity graph on the distinct values with the number of edges in the similarity graph being the number of rows and 2 columns. Each row records the subject indices of the two ends of an edge in the similarity graph.
Arguments
distance
The distance matrix on the distinct values (a "number of unique observations" by "number of unique observations" matrix).
K
The value of k in "k-MST" or "k-NNL" to construct the similarity graph.
n = 50d = 10dat = matrix(rnorm(d*n),n)
sam = sample(1:n, replace = TRUE)
dat = dat[sam,]
# This data has repeated observationsdat_uni = unique(dat)
E = nnl(dist(dat_uni), 1)