Nearest neighbour distance (source code)

= Nearest neighbour distance
{title2=$\rho_{(k)}(x)$}

For observations $X_1,\ldots,X_n$, the <nearest neighbour distance> of order $k$ at $x$ is the $k$th <order statistic> of the distances $|X_i-x|$. An atomless distance <distribution function> ensures ties occur with probability zero.