# How to make new predictions via a trained Gaussian Process?

I've been interested in GP for the past few weeks, and so far, I get how to determine the posterior mean and covariance. But, maybe it's just me, I do not see how, given a new input x, find its image y via the GP model.

For instance, let's say I have an unknown function (blue) and a few observations (red dots) allowed me to compute a mean function (black), an uncertainty domain (green) and some candidates functions (light green)

How can I get the value provided by a candidate function, or more simply, the mean function at a new input, say $$x = -0.5$$? (I do see the value for $$x$$ on the figure, but how can we compute it is my question)

EDIT

On the presented figure, the black, green curves and green shaded area were obtained using informations from the book of Rasmussen. The problem is that the posterior mean or candidates functions are under the form of an $$n$$-dimensional vector. Now, if I want the value of, say, $$x = -0.5,$$ does it mean that I have to manually browse through zip(meanFunction, xSpace) until I have xSpace$${} = -0.5$$ and get the according model value? Or is there another way to extract this knowledge?

Thanks !

• Can you be more specific about what you've tried so far? Do you have the kernel covariance matrices for the 'training' observations and the new input? Are you looking at theory or trying to write some code? – Sullysaurus Oct 27 '17 at 14:02
• Adding to the answer given by Kevin Yang, a more general Equation for mean prediction is 2.38 if you have not assumed you mean function as zero. (Earlier I was confused a lot not knowing this, so trying to make it clear for the OP and others :) – Zeel B Patel Feb 3 at 3:03