I would like to be able to establish whether a sample (let's call it A) is more likely than another sample (let's call it B) to be drawn from the same distribution as a third sample (let's call it C).

Is it possible to use two two-sided Kolmogorov-Smirnov tests comparing A to C and B to C and then obtain a likelihood ratio? I know how to do two separate KS tests in R (see code below), but I don't know how I could calculate from those a likelihood ratio.

A <- rnorm(100, 55, 10)
B <- rnorm(100, 60, 10)
C <- rnorm(100, 50, 10)
ks.test(A, C)
  • $\begingroup$ Is the distribution of $C$ fully known? $\endgroup$
    – utobi
    Feb 24, 2023 at 13:24
  • $\begingroup$ @utobi, no the distribution of C is not fully known. Ideally I would not want to make assumptions about the underlying distribution from which C comes from. I used normal distributions in the example, but actually I am looking for a more general solution that does not assume anything about the distributions from which A, B and C are drawn. $\endgroup$
    – ben
    Feb 24, 2023 at 13:39
  • 2
    $\begingroup$ I see. If you don't assume a distribution you cannot have a likelihood. What you can do is measure the distance between the two distributions by means of, say, the KS metric, empirical KL metric, Wasserstein, etc. $\endgroup$
    – utobi
    Feb 24, 2023 at 13:47


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.