# How to test if two samples are distributed from the same Gaussian process

Given a sequence $\mathbf{x} = (x_1,x_2,\dots,x_n)$ which is sampled from some Gaussian process $GP(\mu_1,\Sigma_1)$ and a "target" sequence $\mathbf{y} = (y_1,y_2,\dots,y_n)$ sampled from another Gaussian process $GP(\mu_2,\Sigma_2)$, does anyone know of a test of whether $\mathbf{x}$ and $\mathbf{y}$ come from the same distribution? I guess I'd like to know the probability $\mathbf{x}$ and $\mathbf{y}$ are from the same distribution (is that even well posed?).

I am not assuming any of $\mu_1,\mu_2,\Sigma_1$ or $\Sigma_2$ are known. Also, I'm okay with assuming the GPs are stationary (but not centered) if that helps.

• Are you sampling both GP's at the same points of the index set? I mean, are you fixing $t_1,\dots,t_n$ and observing the values of the random vectors $(X(t_1),\dots,X(t_n))$ and $(Y(t_1),\dots,Y(t_n))$? – Zen May 29 '13 at 13:52

Let the null hypothesis be that $\mathbf x$ and $\mathbf y$ have the same distribution. Let $\mathbf z = \mathbf x - \mathbf y.$ Under the null, $\mathbf z$ will have a mean of zero and be symmetric. Test the hypothesis that $\mathbf z = \mathbf 0$ using the traditional test. If you reject, you are done.
If you fail to reject, then divide the $x_i - y_i$ into two subsets: those realizations less than zero and those greater than zero. Now use the two-sample KS test on the two halves of your data.