diff --git a/GPy/core/gp.py b/GPy/core/gp.py index a04ac8da..35a41cde 100644 --- a/GPy/core/gp.py +++ b/GPy/core/gp.py @@ -148,7 +148,7 @@ class GP(Model): return Ysim - def posterior_samples(self,X,size=10, full_cov=True, Y_metadata=None): + def posterior_samples(self, X, size=10, full_cov=False, Y_metadata=None): """ Samples the posterior GP at the points X. @@ -163,7 +163,7 @@ class GP(Model): :returns: Ysim: set of simulations, a Numpy array (N x samples). """ Ysim = self.posterior_samples_f(X, size, full_cov=full_cov) - Ysim = self.likelihood.noise_model.samples(Ysim, Y_metadata) + Ysim = self.likelihood.samples(Ysim, Y_metadata) return Ysim diff --git a/GPy/likelihoods/gaussian.py b/GPy/likelihoods/gaussian.py index 032136a7..aaa356b6 100644 --- a/GPy/likelihoods/gaussian.py +++ b/GPy/likelihoods/gaussian.py @@ -94,7 +94,7 @@ class Gaussian(Likelihood): return self.variance + sigma**2 def predictive_quantiles(self, mu, var, quantiles, Y_metadata): - return [stats.norm.ppf(q)*np.sqrt(var) + mu for q in quantiles] + return [stats.norm.ppf(q/100.)*np.sqrt(var) + mu for q in quantiles] def pdf_link(self, link_f, y, extra_data=None): """ diff --git a/GPy/likelihoods/likelihood.py b/GPy/likelihoods/likelihood.py index 67c406df..3eafedb1 100644 --- a/GPy/likelihoods/likelihood.py +++ b/GPy/likelihoods/likelihood.py @@ -397,7 +397,7 @@ class Likelihood(Parameterized): return [np.percentile(ss_y ,q, axis=1)[:,None] for q in quantiles] - def samples(self, gp): + def samples(self, gp, Y_metadata=None): """ Returns a set of samples of observations based on a given value of the latent variable. diff --git a/GPy/likelihoods/student_t.py b/GPy/likelihoods/student_t.py index ce86d9d6..15fd9fa0 100644 --- a/GPy/likelihoods/student_t.py +++ b/GPy/likelihoods/student_t.py @@ -263,7 +263,7 @@ class StudentT(Likelihood): def conditional_variance(self, gp): return self.deg_free/(self.deg_free - 2.) - def samples(self, gp): + def samples(self, gp, Y_metadata=None): """ Returns a set of samples of observations based on a given value of the latent variable. diff --git a/GPy/plotting/matplot_dep/models_plots.py b/GPy/plotting/matplot_dep/models_plots.py index c87eb694..7507c376 100644 --- a/GPy/plotting/matplot_dep/models_plots.py +++ b/GPy/plotting/matplot_dep/models_plots.py @@ -86,8 +86,7 @@ def plot_fit(model, plot_limits=None, which_data_rows='all', upper = m + 2*np.sqrt(v) else: m, v = model.predict(Xgrid, full_cov=False, Y_metadata=Y_metadata) - - lower, upper = model.predict_quantiles(Xgrid, Y_metadata=Y_metadata) + lower, upper = model.predict_quantiles(Xgrid, Y_metadata=Y_metadata) for d in which_data_ycols: