Skip to content
Snippets Groups Projects

Adding a custom dynesty sampler

Merged Gregory Ashton requested to merge add-custom-dynesty-sampler into master

This implements a locally-defined dynesty rwalk sampler. The initial motivation to do this is we believe dynesty has a bug in the case when "None" boundaries are used. We will, after testing put this fix back into dynesty itself so that other members of the community can benefit. But, it is also useful to be able to fiddle in the guts of the sampler!

For future reference, the changes in this MR are largely procedural. Except, the line

    while nc + nfail < walks or accept == 0:

In dynesty, this line is

    while nc < walks or accept == 0:

The change was suggested by @colm.talbot. My interpretation is that, without adding the nfail, the times when the sampler walks outside the bounds aren't counted causing a bias.

What will this effect?

This will effect any runs where the boundary=None for one of the priors. In the past, we have recommended people always use boundary='reflective' because of the odd behaviour we saw when using no prior boundary. However, the demonstration below suggests that this was in fact just buggy behaviour.

Demonstration for GW150914

The following runs are done using a mass_ratio prior with None boundary. Note that runs done as part of the initial bilby review where done with a reflective prior. It is likely these suffered with this issue at some level, but it was perhaps not so clear due to large numbers of walks etc.

Here is the mass parameters for GW150914 with the old behaviour:

image

Here is the mass parameters for GW150914 with the new behaviour:

image

The mass ratio here rail, but smoothly against the prior, in much better agreement with runs for LALInference.

Edited by Gregory Ashton

Merge request reports

Pipeline #87685 passed

Pipeline passed for 30fd0803 on add-custom-dynesty-sampler

Test coverage 70.00% (0.00%) from 1 job
Approved by

Merged by Gregory AshtonGregory Ashton 5 years ago (Nov 12, 2019 4:58am UTC)

Merge details

  • Changes merged into master with a61ded22 (commits were squashed).
  • Deleted the source branch.

Pipeline #88270 passed

Pipeline passed for a61ded22 on master

Test coverage 70.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
Please register or sign in to reply
Loading