Efficient test if 2-D samples are uniformly distributed?

21 Views Asked by At

Assume that I have a collection of $N$ samples in the two-dimensional interval $\mathbb{R}^{[0,1]\times [0,1]}$. I seek an (efficient) metric which would allow me to quantify how close those samples are to being uniformly distributed inside this interval. Do you know of any such metric, or do you have ideas on how to tackle this challenge?

Some ideas of my own:

  • subdivide the 2-D area into uniform squares, count the samples in each square, then calculate the standard deviation of the counts in each square. In the large sample limit, this standard deviation should be zero if the samples are uniformly distributed. Problems: Depends on the resolution of the squares, and doesn't really work in small sample size regimes.

  • Divide the interval along one of the dimensions, then count the samples to both sides. As an example, cutting at $x=0.4$, we would expect $40$% of the samples to the left and $60%$ of the samples to the right. Calculate the mismatch between the expected and actual percentages. Repeat this several times with different cuts. As this is also a form of binning, it has the same problems as the method above.

Do you have any other suggestions?