bilby-dev / bilby

A unified framework for stochastic sampling packages and gravitational-wave inference in Python.
https://bilby-dev.github.io/bilby/
MIT License
68 stars 76 forks source link

Interaction between relative binning initial search and calibration parameter sampling #738

Open bilby-bot opened 1 year ago

bilby-bot commented 1 year ago

In GitLab by @git.ligo:aaron.zimmerman on Mar 24, 2023, 18:08

When I run bilby_pipe with dynesty with both calibration-model = CubicSpline (using a standard calibration envelope) and likelihood-type=bilby.gw.likelihood.relative.RelativeBinningGravitationalWaveTransient the run fails when attempting to use the optimizer to find a fiducial point. @git.ligo:colm.talbot points out this is because the optimizer does not support domains with infinite prior support. I will check if specifying a fiducial point can allow for sampling to begin and update this issue.

My environment info is:

bilby_pipe version: 1.0.8
Running bilby version: 2.0.1

The traceback of the failed run is in the .err file in log_data_generation, and is

Traceback (most recent call last):
  File "/home/sylvia.biscoveanu/.conda/envs/bilby_o4review_230314/bin/bilby_pipe_generation", line 10, in <module>
    sys.exit(main())
  File "/home/sylvia.biscoveanu/.conda/envs/bilby_o4review_230314/lib/python3.9/site-packages/bilby_pipe/data_generation.py", line 1357, in main
    data.save_data_dump()
  File "/home/sylvia.biscoveanu/.conda/envs/bilby_o4review_230314/lib/python3.9/site-packages/bilby_pipe/data_generation.py", line 1193, in save_data_dump
    likelihood = self.likelihood
  File "/home/sylvia.biscoveanu/.conda/envs/bilby_o4review_230314/lib/python3.9/site-packages/bilby_pipe/input.py", line 1197, in likelihood
    likelihood = Likelihood(**likelihood_kwargs)
  File "/home/sylvia.biscoveanu/.conda/envs/bilby_o4review_230314/lib/python3.9/site-packages/bilby/gw/likelihood/relative.py", line 166, in __init__
    self.fiducial_parameters = self.find_maximum_likelihood_parameters(
  File "/home/sylvia.biscoveanu/.conda/envs/bilby_o4review_230314/lib/python3.9/site-packages/bilby/gw/likelihood/relative.py", line 270, in find_maximum_likelihood_parameters
    output = differential_evolution(
  File "/home/sylvia.biscoveanu/.conda/envs/bilby_o4review_230314/lib/python3.9/site-packages/scipy/optimize/_differentialevolution.py", line 377, in differential_evolution
    with DifferentialEvolutionSolver(func, bounds, args=args,
  File "/home/sylvia.biscoveanu/.conda/envs/bilby_o4review_230314/lib/python3.9/site-packages/scipy/optimize/_differentialevolution.py", line 689, in __init__
    raise ValueError('bounds should be a sequence containing '
ValueError: bounds should be a sequence containing real valued (min, max) pairs for each value in x
bilby-bot commented 1 year ago

In GitLab by @git.ligo:colm.talbot on Apr 11, 2023, 14:59

For bilby_pipe this is resolved in https://git.ligo.org/lscsoft/bilby_pipe/-/merge_requests/525. We should still put in a general fix to the optimization for parameters with infinite domains. I also recently noticed that the optimization doesn't obey Constraint priors, which it probably makes sense to resolve at the same time.