# estimate equal distribution of few points on a line

I am trying to find the best solution to estimate equal distribution of points over a line. I know I can use relative SD or similar, but I was wondering if there are more "specific" methods that can work on a limited number of points (<10) and can take into account the differences in line lengths etc and output an "absolute" number that allows comparison.

Thanks a lot in advance for any help!

• what is "equal distribution over a line"? – Aksakal May 25 '19 at 17:16

If by 'equal distribution' you man uniformly distributed, then you can do a formal Kolmogorov-Smirnov test.

Small samples: However, a random sample of only ten observations is too small for any test to distinguish reliably among distributions. There is simply not information in ten observations to judge what the population distribution might be.

For example, if $$U_1, U_2, \dots, U_{10},$$ is a random sample from $$\mathsf{Unif}(0,1),$$ then a ks.test in R returns a relatively large P-value, indicating that the sample is consistent with this uniform distribution.

set.seed(525); u = runif(10)
stripchart(u, pch=19, xlim=c(0,1))
ks.test(u, "punif", 0, 1)

One-sample Kolmogorov-Smirnov test

data:  u
D = 0.20838, p-value = 0.7049
alternative hypothesis: two-sided


However, if $$X_1, X_2, \dots, X_{10},$$ is a random sample from $$\mathsf{Beta}(12,12),$$ the data have a tendency to cluster near the center of the interval $$(0,1).$$ Even so, the Kolmogorov-Smirnov test also finds this sample to be consistent with $$\mathsf{Unif}(0,1).$$ (The P-value is smaller than above, but not small enough to lead to rejection of the null hypothesis.)

set.seed(519); x = rbeta(10, 12, 12)
stripchart(x, pch=19, xlim=c(0,1))
ks.test(x, "punif", 0, 1)

One-sample Kolmogorov-Smirnov test

data:  x
D = 0.35493, p-value = 0.1242
alternative hypothesis: two-sided


Large samples: By contrast, the KS-test works much better for samples of size $$n = 100.$$ The uniform sample is judged consistent with $$\mathsf{Unif}(0,1)$$ (P-value $$0.98 > .05),$$ while the beta sample is clearly rejected (P-value nearly $$0).$$ The plots also show a clear distinction between the distributions of the two samples.

set.seed(525); u = runif(100)
ks.test(u, "punif", 0, 1)$p.val [1] 0.9581569  set.seed(519); x = rbeta(100, 12, 12) ks.test(x, "punif", 0, 1)$p.val
[1] 2.025735e-10


Below histograms of the two saples of size $$n = 100$$ are shown along with density functions of their respective population distributions. Even for samples of size 100, the fit of the histograms to density curves is only rough. Distribution identification is difficult unless you have large samples.

• how would you make a uniform distribution on a line? A line is unbounded, the uniform is bounded – Aksakal May 25 '19 at 17:15
• There is no such thing as a uniform distribution on the real line. To an extent, you can try to 'imitate' that by picking extreme endpoints [such as UNIF(-10000, 10000)] or or huge standard deviations [such as NORM(0, 10000)]. // In Bayesian statistics such 'distributions' are considered as limiting prior distributions called 'improper' priors. – BruceET May 25 '19 at 17:31