mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-05-10 20:42:39 +02:00
fix the issue of negative prediction variance of normal GP
This commit is contained in:
parent
5f417565fb
commit
8b279175c5
6 changed files with 84 additions and 5 deletions
|
|
@ -212,6 +212,12 @@ class GP(Model):
|
|||
= N(f*| K_{x*x}(K_{xx} + \Sigma)^{-1}Y, K_{x*x*} - K_{xx*}(K_{xx} + \Sigma)^{-1}K_{xx*}
|
||||
\Sigma := \texttt{Likelihood.variance / Approximate likelihood covariance}
|
||||
"""
|
||||
if hasattr(self.posterior, '_raw_predict'):
|
||||
mu, var = self.posterior._raw_predict(kern=self.kern if kern is None else kern, Xnew=Xnew, pred_var=self._predictive_variable, full_cov=full_cov)
|
||||
if self.mean_function is not None:
|
||||
mu += self.mean_function.f(Xnew)
|
||||
return mu, var
|
||||
|
||||
if kern is None:
|
||||
kern = self.kern
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue