Say we have a sample space of size $N$ . What's a good way to measure how close the values are to one another? In other words, to what degree are the values 'equal' to one another? I thought of a couple of ways, but I'm certain there are more established methods to calculate this degree of closeness/uniformity.
1/ The coefficient of variation - It's defined as the ratio of the standard deviation to the mean. However, in this case we would be computing how close the values are to the mean, and not to each other. I guess this would be fine?
2/ Calculate the mean of the pairwise difference. This would be -
$\left( \dfrac{1}{^{N-1}C_{2}} \right) \cdot \sum\limits_{n=1}^{N-1} \sum\limits_{m=n+1 \\ m\neq n}^{M} \left\vert X(n) - X(m) \right\vert $
where $X(i)$ is the $i^{th}$ value. We could also extend the above formula to the second degree -
$\left( \dfrac{1}{^{N-1}C_{2}} \right) \cdot \sqrt{ \sum\limits_{n=1}^{N-1} \sum\limits_{m=n+1 \\ m\neq n}^{M} \left\vert X(n) - X(m) \right\vert ^{2} }$
Naturally, the lesser the above values are, the closer the $N$ values would to be one another. Any comments/improvements? Maybe there are some distance metrics?
An alternative formula for the variance of a sample $X_1, X_2, \dots, X_n$ is Ref Item #13: $$ S^2 = \frac{1}{2n(n-1)}\sum_{i-1}^n\sum_{j=1}^n (X_u-X_j)^2.$$
Thus the sample variance can be viewed as a measure of pairwise distances between sample points. Large $S^2$ corresponds to large (squared) differences among sample values.
Thus you might use $1/S^2,$ sometimes called the sample 'precision' as a measure of closeness of values.