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)Gaussian Process Regression

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)


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 !

  • 2
    $\begingroup$ 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? $\endgroup$ – Sullysaurus Oct 27 '17 at 14:02
  • $\begingroup$ 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 :) $\endgroup$ – Zeel B Patel Feb 3 at 3:03

The closed form expressions for the posterior mean and variance can be found in Equations 2.25 and 2.26 on page 17 of Gaussian Processes for Machine Learning. If you need help with those, feel free to add comments here.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.