bilby-dev / bilby

A unified framework for stochastic sampling packages and gravitational-wave inference in Python. Note that we are currently transitioning from git.ligo.org/lscsoft/bilby, please bear with us!
https://bilby-dev.github.io/bilby/
MIT License
57 stars 63 forks source link

RelativeBinning optimisation doesn't account for Constraint priors #741

Open bilby-bot opened 1 year ago

bilby-bot commented 1 year ago

In GitLab by @git.ligo:cjhaster on Apr 26, 2023, 20:46

When using the RelativeBinningGravitationalWaveTransient I've specified the fiducial waveform in terms of {"chirp_mass": 3.163, "mass_ratio": 0.383, etc}. This is a NSBH injection, that I want to analyse using the SEOBNRv4_ROM_NRTidalv2_NSBH waveform. When the likelihood is initialised, it by default does the update_fiducal_parameters step, and with the setup I used (optimising over the prior, since I hadn't specified any dedicated parameter_bounds) it "only" looks to optimise over chirp_mass and mass_ratio. The problem is that the SEOBNRv4_ROM_NRTidalv2_NSBH model is only supported for 1 < mass_2 < 3. I account for this in the actual Bilby configuration by having a mass_2 = Constraint(name='mass_2', minimum=1.0, maximum=3.0) in my prior, but since mass_2 isn't in the self.parameters_to_be_updated list (see here) that Constraint will not be accounted for, and the optimisation will fail since it'll try to evaluate SEOBNRv4_ROM_NRTidalv2_NSBH at a point that's nominally inside the chirp_mass and mass_ratio priors, but has a too-high NS mass.

bilby-bot commented 1 year ago

In GitLab by @git.ligo:colm.talbot on Apr 27, 2023, 03:51

I saw this (and then forgot to document it.) This is true, although you can workaround by setting catch_waveform_errors=True for the waveform generator.

bilby-bot commented 1 year ago

In GitLab by @git.ligo:cjhaster on Apr 27, 2023, 03:55

my "solution" was to set update_fiducial_parameters=False which was fine in this case since I knew what the injected WF was (I set my fiducial WF to be very close but not exactly at the injection). But this workaround is a bit fishy for real analyses :stuck_out_tongue:

bilby-bot commented 1 year ago

In GitLab by @git.ligo:cjhaster on Apr 27, 2023, 03:57

I have catch-waveform-errors=True in my config, and still got the error :cry:

bilby-bot commented 1 year ago

In GitLab by @git.ligo:colm.talbot on Apr 27, 2023, 11:05

I guess this is a difference between the EOB and Phenom NSBH models.