Open cwlgadd opened 6 years ago
Also another bug, which is very likely the cause, is evident when plotting the prior:
import GPy
import matplotlib.pyplot as plt
if __name__ == '__main__':
prior = GPy.priors.Uniform(0,1)
prior.plot()
plt.show()
The cause of the bug is:
def lnpdf(self, x):
region = (x >= self.lower) * (x <= self.upper)
return region
where you assign log density within the bounds as 1 and outside as 0. This gives density e^1 within the bounds and and e^0 outside.
Calling HMC with a Uniform prior gives the wrong results. A simple example showing the behaviour I experienced:
This gives posterior samples outside the support of the prior, where there should be no density. In the plot, prior samples are in blue whilst posterior samples are in orange. I tried it with and without ARD and got the same results.
I was using Python 3.6.1 and GPy version 1.9.2