def prob(self, gauss): """Returns the probability of drawing the provided Gaussian from this prior.""" d = self.mu.shape[0] wishart = Wishart(d) gaussian = Gaussian(d) wishart.setDof(self.n) wishart.setScale(self.getLambda()) gaussian.setMean(self.mu) gaussian.setPrecision(self.k * gauss.getPrecision()) return wishart.prob(gauss.getPrecision()) * gaussian.prob(gauss.getMean())
def prob(self, gauss): """Returns the probability of drawing the provided Gaussian from this prior.""" d = self.mu.shape[0] wishart = Wishart(d) gaussian = Gaussian(d) wishart.setDof(self.n) wishart.setScale(self.getLambda()) gaussian.setMean(self.mu) gaussian.setPrecision(self.k*gauss.getPrecision()) return wishart.prob(gauss.getPrecision()) * gaussian.prob(gauss.getMean())