what do you mean by similarity? do you mean how much similar their function's shape are?or you mean the similarity between two random variables? or ow much independent they are?......
If you have two different datasets and you are trying to compare their distribution, it is good to obtain their CDFs first and then perform residual sum of squares on the difference between these CDFs.
However, if you have a dataset and you are trying to see to which "known" distribution is mostly belongs, you may try the available mathematical tools such as MatLab, using the tool "distfit". You may refer to the following publication were the authors used a distribution fitting.
Conference Paper Path Loss Study for Millimeter Wave Device-to-Device Communi...
@Akram Hourani: I want to find out the outlier by comparing two data sets( in that case, sample size if two data set are not equal) . I don't know the how they distributed.That's why i go for non-parametric way. I am estimating the distribution of two data set using histogram. Then i want to compare their data distribution and see the similarities using divergence tool. so in that case do u think ur suggested procedure works? do you think ur procedure is efficient then my procedure? if so, then please explain a little..why do i take CDF instead of taking PDF....
@Hossein Soleimani : i am interested to see the similarities of their distribution function.