Skip to content
Snippets Groups Projects

add jacobian to prior

Closed Colm Talbot requested to merge prior-jacobians into master

This adds the option to pass a Jacobian function to the PriorDict. This allows non-trivial priors to be placed on non-sampled parameters.

This is a method to reproduce the uniform in component mass priors while sampling in chirp mass and mass ratio.

I'm not sure whether we want this feature as it complicates the interaction with some nested samplers, thoughts?

If we decide we do want it I'll make sure to add an example of using this somewhere.

Edited by Colm Talbot

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Gregory Ashton
  • 388 388 self.check_draw(draw)
    389 389 return draw
    390 390
    391 def check_draw(self, draw):
    392 """ Checks if the draw will generate an infinite prior or likelihood """
    393 if np.isinf(self.log_likelihood(draw)):
    394 logger.warning('Prior draw {} has inf likelihood'.format(draw))
    395 if np.isinf(self.log_prior(draw)):
    396 logger.warning('Prior draw {} has inf prior'.format(draw))
    391 def get_initial_points_from_prior(self, npoints=1):
    • Is it possible (or worthwhile) to move all the instances where the jacobian is used into if/else statements? I can see two reasons to do this: (a) code-contamination, if there is something odd in the Jacobian code it won't adversely effect anything else and (b) run-time. This would be an alternative to having the jacobian return 1 if no other Jacobian is specified.

      I'm happy if you feel that isn't a good idea, but just want to check.

    • Author Maintainer

      I think I've done what you're asking.

    • Please register or sign in to reply
    • There is no additional testing added here. I think we'd need to run the fiducial tests again to see everything is okay.

      Perhaps this can be made into another issue, but it might be nice to have a C.I. test which: defines a set of parameters which use both the constraints and Jacbian's. Sample them a few 100 times, check that none of the generated samples have infinite priors.

    • Author Maintainer

      I'm not entirely sure I understand your point here.

    • Please register or sign in to reply
  • Colm Talbot added 17 commits

    added 17 commits

    • 270af78a...f9379f4f - 12 commits from branch master
    • 8ee63783 - Merge branch 'master' into prior-jacobians
    • 024991f0 - allow reading of constraints/jacobians from prior file
    • 73df3331 - add helper function for dynamic imports
    • 7ec21e24 - add some common jacobians
    • 6d19ca70 - make default BNS prior use jacobian and sample in chirp mass/mass ratio

    Compare with previous version

  • Gregory Ashton changed milestone to %0.5.2

    changed milestone to %0.5.2

  • Colm Talbot added 18 commits

    added 18 commits

    Compare with previous version

  • Colm Talbot added 1 commit

    added 1 commit

    Compare with previous version

  • Colm Talbot added 4 commits

    added 4 commits

    Compare with previous version

  • Colm Talbot unmarked as a Work In Progress

    unmarked as a Work In Progress

  • Colm Talbot added 1 commit

    added 1 commit

    • bfe066f9 - simplify conversion function/jacobian setting

    Compare with previous version

  • Colm Talbot added 1 commit

    added 1 commit

    Compare with previous version

  • Colm Talbot added 1 commit

    added 1 commit

    • 5901407f - fix constraint checks for trivial constraints

    Compare with previous version

  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Please register or sign in to reply
    Loading