Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add periodic reparameterisation #127

Merged
merged 6 commits into from
Nov 17, 2021
Merged

Conversation

mj-will
Copy link
Owner

@mj-will mj-will commented Nov 17, 2021

I recently realised that the time_jitter used in the time marginalisation for CBC signals in bilby is actually a periodic parameter (see here). This prompted me to add a generic reparameterisation for parameters that aren't periodic on [0, pi] or [0, 2pi].

The scale for generic periodic parameters is set as 2pi / angle_prior_range, for example for a parameter that is periodic on [-1, 1] the scale should be pi. This behaviour is enabled by setting scale=None.

Bug fix
This PR also fixes a minor bug in all reparameterisations when parameters=<some list>: the list is not copied to changes to the parameters made in the reparameterisation will be reflect in the original list. This could lead to unexpected behaviour if that list is used in other parts of the code.

@mj-will mj-will added bug Something isn't working enhancement New feature or request labels Nov 17, 2021
@mj-will mj-will added this to the v0.4.0 milestone Nov 17, 2021
@codecov-commenter
Copy link

codecov-commenter commented Nov 17, 2021

Codecov Report

Merging #127 (ca977b1) into main (bc3eec0) will increase coverage by 0.03%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #127      +/-   ##
==========================================
+ Coverage   95.00%   95.03%   +0.03%     
==========================================
  Files          39       39              
  Lines        3626     3629       +3     
==========================================
+ Hits         3445     3449       +4     
+ Misses        181      180       -1     
Flag Coverage Δ
unittests 95.03% <100.00%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
nessai/reparameterisations.py 91.56% <100.00%> (+0.21%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bc3eec0...ca977b1. Read the comment docs.

@mj-will mj-will merged commit 74fa449 into main Nov 17, 2021
@mj-will mj-will deleted the add-periodic-reparameterisation branch November 17, 2021 16:59
@mj-will mj-will mentioned this pull request Nov 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants