The constructor sets
self.s = s self.inv_s = 1. / s self.v = v
where v is the “Diagonal of covariance matrix for the potential vector”
But then random and the energy are defined as
def random(self): """Draw random value from QuadPotential.""" return floatX(normal(size=self.s.shape)) * self.inv_s def energy(self, x, velocity=None): """Compute kinetic energy at a position in parameter space.""" if velocity is not None: return 0.5 * np.dot(x, velocity) return .5 * x.dot(self.v * x)
This is backwards. You multiply by the scale to get a random sample and divide by the variance to get the pdf of a Gaussian.
Is this a bug? Or there is some intentional implicit transformations here? All the quad potential classes are the same way.