15 D analytical Gaussian
The desired analytical 15 D Gaussian example @matthew-pitkin @gregory.ashton @colm.talbot
Merge request reports
Activity
mentioned in issue #387 (closed)
- Resolved by Matthew Pitkin
- Resolved by Matthew Pitkin
- Resolved by Moritz Huebner
Could you also add an example with the bimodal Gaussian? Like in LALInference you could set them to be 8 sigma apart around a mean of zero. You could just alter the above
Likelihood
class with the following__init__()
andlog_likelihood()
methods:def __init__(self, mean, cov): super(AnalyticalMultidimensionalCovariantGaussian, self).__init__(parameters=dict()) self.cov = np.array(cov) self.sigma = np.sqrt(np.diag(self.cov)) self.mean1 = np.array(mean) + 4. * self.sigma self.mean2 = np.array(mean) - 4. * self.sigma self.pdf1 = multivariate_normal(mean=self.mean1, cov=self.cov) self.pdf2 = multivariate_normal(mean=self.mean2, cov=self.cov) def log_likelihood(self): x = np.array([self.parameters["x{0}".format(i)] for i in range(self.dim)]) return -np.log(2) + self.pdf1.logpdf(x) + self.pdf2.logpdf(x)
@moritz.huebner I've run the script myself now and it all looks good. I get the right evidence and everything!
@matthew-pitkin Nice, I will polish this a bit up then before we merge it in.
added 2 commits
added 1 commit
- dd069b53 - Moved log likelihood calculation into log space
- Resolved by Moritz Huebner
Hi @moritz.huebner, this all looks good to me, so I'm happy to approve this. I noticed on the review page, that for the bimodal Gaussian one of the modes seems to be slightly more favoured than the other. Could you try re-running with a higher number of live points to see if that evens out the modes a bit more?
mentioned in commit c3eec19b