Solved – How to generate random points in the volume of a sphere with uniform nearest neighbour distances

clusteringgeometryrandomnessuniform distribution

With respect to post (1) and post (2), I generated a large number of uniformly distributed points inside the ball of radius $R$ using $\frac{R_s U^{1/3}}{\sqrt{X_1^2 + X_2^2 + X_3^2}} (X_1, X_2, X_3)$, where $U$ is uniformly distributed between 0 and 1, and $X_1, X_2, X_3$ are independent normal random variables with mean 0 and variance 1.
The following figure shows a uniform spherical distribution obtained by this method using 10000 independent draws in a sphere of radius 10.
enter image description here

By computing the nearest neighbour distance $d_i$ of every point, I observed that the diagnostic plot of nearest neighbour distances does not follow a uniform distribution. Does this non-uniform distribution mean that one can cluster the points? Does it mean points dont have spatial randomness? If so, then how can I generate random points with uniform nearest neighbour distances.


Temporary images for @Anony-Mousse consideration:
enter image description here
enter image description here

Best Answer

I wouldn't expect the distribution of the nearest neighbour distances to be uniform under spatial randomness.

According to Wikipedia (http://en.wikipedia.org/wiki/Complete_spatial_randomness), the distance of the first neighbour in your case has the following distribution:

$P_1(r) = 3\lambda r^2\exp(-\lambda r^3)$

where $\lambda$ is ta density dependent parameter. This is obviously non-uniform!

Concerning your clustering question: You can always cluster points, independently of their distribution.

Related Question