Home   >   User Resources   >   Online Help   >   apakNearestNeighbour.Distances.k
 

 

Function index Version 3.0.0

apakNearestNeighbour.Distances.k(k, DataMatrix)

Excel=apakNearestNeighbour.Distances.k(k, DataMatrix)

Result

Returns the distance of each data point to its k-th nearest neighbor (k-th kNN distance).

Syntax

k: rank of the neighbor, between 1 and c - 1

DataMatrix: r x c data matrix

Remarks

Neighbors are ranked by Euclidean distance; ties are broken by the lower column index. A data point is never its own neighbor, even if other data points have the same coordinates.

Pressing Esc aborts the calculation; the function then returns "Calculation aborted by user."