The setup of my problem is that I have some response variable, $Y$, and a predictor, $X$. I have measurements on both variables from two groups. In each group, there is one $Y$ per $X$. I want to compare the curves in $\mathbb{R}^2$ and assess if they were generated by the same process. An idea that has been floated past me is to use the Kolmogorov-Smirnov test. I do not see this problem as a univariate comparison between groups, so KS, to me, is invalid. However, the idea of measuring the maximum distance between curves appeals to me.
In studying the nitty-gritty of the KS test, I see that the p-value comes from comparing the maximum vertical distance between CDFs to a distribution related to a Brownian bridge between the CDFs (something like that). This idea makes sense to me in more generality. If any two curves are generated by some process, sampling will cause the curves not to be the same, but we can say if the lack of similarity is likely to occur if the two curves were generated by the same process; then the standard KS test is a special case.
My Questions
1) Has this idea been worked out in the generality I describe?
2) Is there a software implementation of this idea?
I have found this thread that seems to address my question about comparing curves, and while the dynamic time warping method may be superior, I want to pursue an approach like KS.
Thanks!
PS: The curves are assured to be non-increasing, if that matters.