add jacobian to prior
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.
Merge request reports
Activity
changed milestone to %0.5.1
added 84 commits
-
dac40af3...a4eef56a - 75 commits from branch
master
- ddd4789a - Initial attempt at providing live_points to dynesty
- 54db49c9 - Switch the order of prior and likelihood checking
- be02616a - Update bilby/core/sampler/base_sampler.py
- b514c425 - Fix flake8 issues
- 7df1e216 - Merge branch 'master' into 367-generate-initial-live-points-in-dynesty
- 00218ea6 - Merge branch 'master' into prior-jacobians
- 01746748 - Merge remote-tracking branch...
- 72bb6521 - typo fix
- a8f9d0b7 - improve sampler testing
Toggle commit list-
dac40af3...a4eef56a - 75 commits from branch
added 9 commits
-
cc0727f4...9aa84e19 - 8 commits from branch
master
- 270af78a - Merge branch 'master' into prior-jacobians
-
cc0727f4...9aa84e19 - 8 commits from branch
- Automatically resolved by Colm Talbot
- Resolved by Colm Talbot
- Automatically resolved by Colm Talbot
- Resolved by Colm Talbot
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 intoif/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 thejacobian
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.
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.
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
Toggle commit list-
270af78a...f9379f4f - 12 commits from branch
changed milestone to %0.5.2
added 18 commits
-
6d19ca70...5621baec - 17 commits from branch
master
- 79b23c09 - Merge branch 'master' into prior-jacobians
-
6d19ca70...5621baec - 17 commits from branch
added 1 commit
- bfe066f9 - simplify conversion function/jacobian setting
added 1 commit
- 5901407f - fix constraint checks for trivial constraints