Solved – Comparing two curves with different x-axis points – appropriate test

MATLABnonlinear regressionprobabilityregression

I have two curves and I want to be able to calculate the probability of these curves coming from different distributions or another appropriate statistic.

Each curve is fitted through the mean of clusters of data (x's and o's in diagram) at differing points on the x-axis, each data cluster is also non-parametrically distributed.

Is there a statistical test that would be appropriate to tell me how likely it is that the data/curves come from different distributions i.e. one is significantly different than the other?

        +   -         x
        |    o        ~
        |    -        x~
        |    o         ~
        |     -        ~~
        |     --        ~~
        |      -         ~
        |      --         ~~~
        |       -            ~~~
        |       -               ~~    x
        |        -o               ~~~ x
        |         -                  ~~ 
        |         o-                  x  ~ 
        |         o-                  x   ~ ~~             x
        |           --                        ~~~ ~~~~~~~~~~~
        |            ----        o                         x
        |                - ----  o                         x
        |                      ----- ----               o
        |                        o       - ---- - -  - ---
        |                                               o
        |
        +----------------------------------------------------------+

I've looked here Comparison of two curves but I believe my problem has some distinct differences

Best Answer

You might be looking for the two sample K-S test.

Matlab Stats toolbox has an implementation, kstest2:

kstest2(x1,x2) returns a test decision for the null hypothesis that the data in vectors x1 and x2 are from the same continuous distribution, using the two-sample Kolmogorov-Smirnov test. The alternative hypothesis is that x1 and x2 are from different continuous distributions.