I have two sets of random floats between [0,1], each one with a different number of elements:
$$A = \{0.3637852, 0.2330702, 0.1683102, 0.2127219, 0.0152532, ..., N_A\}$$ $$B = \{0.4541056, 0.7521812, 0.0266602, 0.5099002, 0.3468181, ..., N_B\}$$
where $N_B > N_A$.
I need to asses the similarity between these two sets disregarding the difference in number of elements (ie: the fact that $N_B > N_A$ should not play a role in the similarity assesment) since I'm only interested in how the values are scattered between [0,1], not how many of them there are in each set.
So far I've applied the 1D kde.test
available in Duong's R package 'ks' (see page 27) which returns a p-value
, and I've also applied the python
function scipy.stats.ks_2samp which is a 1D Kolmogorov-Smirnov statistic which returns a "KS statistic" and a "two-tailed p-value".
My questions are:
1- Is one of these statistics (KDE's p-value, KS statistic or the two-tailed p-value) recommended for my needs? If so, why?
2- What is the difference between the "KS statistic" and a "two-tailed p-value"?
3- Will the difference in the number of elements in each set affect the outcome of these statistics? If so, how can I avoid that? Is it even possible?