# Test if a data point originated from a gaussian process when confidence region is wide

My question is about calculating the probability that a data point was generated from a gaussian process

My setting:

I have a training set of pairs of observations denoted $$\mathbf{x} = ((x_1,y_1),(x_2,y_2),\dots,(x_n,y_n))$$ and I use this observations to train a gaussian process:

$$y \sim GP(m(x),k(x,x')$$

Where $$m(x)$$ is the mean function and $$k(x,x')$$ is the covariance function.

Now, for a test observation pair $$(x_{n+1},y_{n+1})$$ I would like to know the probability that the observation $$y_{n+1}$$ was generated by the gaussian process I have trained using the training set mentioned above.

To do so, I run the observation $$x_{n+1}$$ through the trained $$GP$$ to obtain the posterior predictive mean value $$y^*$$ and the cofidence region ($$2\sigma$$).

In order to test if the observation $$y_{n+1}$$ belongs to the gaussian process, I calculate its $$z$$ score by:

$$\Large{z = \frac{y^*-y_{n+1}}{\sigma}}$$

And then I simply transfrom the $$z$$-score this into a probability using $$2*\phi(|z|)$$, where $$\phi$$ is the cumulative distribution function.

Problem:

The approach mentioned above works well when the the confidence intervals of the $$GP$$ are narrowed due to the decrease in uncertainity gained when we are in close proximity to the training examples. However, when we get far from the training examples and the uncertainity increases, the confidence gets very wide and I will like to penalize for that. As I no longer know what is the "truth" underlaying gaussian process. And consequently, I do not know if the test point was generated from the gaussian process.

Question:

Is there a way to calculate the probablity of a point having originated from a gaussian process taking into account large confidence regions?

Thanks!

• What exactly is the problem with wide prediction intervals far from the training data? If you know that the underlying process has a certain structure that makes this sort of behaviour undesirable, change your covariance function to reflect that or use something other than Gaussian Processes.
– Will
Jul 1, 2020 at 13:00
• I have no problem with large confidence intervals far from training data. The task, in my opinion is well suited for a GP based model. However, when I calculate a probability of a point originating from a gaussian process downstream, I would like to take into account that the confidence region is large Jul 1, 2020 at 13:04
• Aren't you already doing that when you compute the posterior predictive probability?
– Will
Jul 1, 2020 at 13:11
• Yes, I am doing that. But If the posterior predictive distribution is too wide, it will always be likely that they will contain value. Is there a way to restrict that? Jul 1, 2020 at 13:28
• Why would you want to restrict the confidence intervals and what means "too wide"? "Too wide" for what? Your conficence intervals are what they are, given your assumptions (i.e. GP with a certain $m$ $k$ and your observations). If you have reasons (which?) to believe they should be more narrow, you must change your assumptions, i.e. choose a different prior distribution.
– g g
Jul 2, 2020 at 20:55