Skip to content
Snippets Groups Projects

15 D analytical Gaussian

Merged Moritz Huebner requested to merge 15_d_gaussian_review into master
All threads resolved!

The desired analytical 15 D Gaussian example @matthew-pitkin @gregory.ashton @colm.talbot

Edited by Moritz Huebner

Merge request reports

Pipeline #69894 passed

Pipeline passed for dd069b53 on 15_d_gaussian_review

Test coverage 69.00% (0.00%) from 1 job
Approval is optional

Merged by Moritz HuebnerMoritz Huebner 5 years ago (Jul 22, 2019 4:22am UTC)

Pipeline #71097 passed

Pipeline passed for c3eec19b on master

Test coverage 68.00% (0.00%) from 1 job

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • 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__() and log_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! :smile:

  • @matthew-pitkin Nice, I will polish this a bit up then before we merge it in.

  • Moritz Huebner added 2 commits

    added 2 commits

    • b0012448 - Some preliminary changes
    • 87dffbeb - Added bimodal distribution and cleaned up some stuff

    Compare with previous version

  • Moritz Huebner added 1 commit

    added 1 commit

    Compare with previous version

  • Moritz Huebner added 1 commit

    added 1 commit

    • dd069b53 - Moved log likelihood calculation into log space

    Compare with previous version

  • Moritz Huebner unmarked as a Work In Progress

    unmarked as a Work In Progress

  • Matthew Pitkin approved this merge request

    approved this merge request

  • Colm Talbot approved this merge request

    approved this merge request

  • Moritz Huebner resolved all discussions

    resolved all discussions

  • Moritz Huebner resolved all discussions

    resolved all discussions

  • Moritz Huebner mentioned in commit c3eec19b

    mentioned in commit c3eec19b

  • Please register or sign in to reply
    Loading