fixing qualtile code for some likelhoods

This commit is contained in:
James Hensman 2015-08-13 12:07:01 +01:00
parent 2af47f1d31
commit 9780fb48de
2 changed files with 14 additions and 3 deletions

View file

@ -232,6 +232,17 @@ class Bernoulli(Likelihood):
np.seterr(**state)
return d3logpdf_dlink3
def predictive_quantiles(self, mu, var, quantiles, Y_metadata=None):
"""
Get the "quantiles" of the binary labels (Bernoulli draws). all the
quantiles must be either 0 or 1, since those are the only values the
draw can take!
"""
p = self.predictive_mean(mu, var)
return [np.asarray(p>(q/100.), dtype=np.int32) for q in quantiles]
def samples(self, gp, Y_metadata=None):
"""
Returns a set of samples of observations based on a given value of the latent variable.