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

UltraNest fitting method added to example_16 #145

Merged
merged 21 commits into from
Sep 22, 2024

Conversation

rapoliveira
Copy link
Contributor

Implementation of the UltraNest fitting method to example_16, using several functions similar to MultiNest.
There are no required parameters to run, but some optional parameters that may be useful in some cases were added.

Commented lines were added to ob03235_2_full.yaml file, but a YAML file specific for the application of UltraNest to the same data is also included. Comments are welcome!

My impression is that the algorithm was not very effective in finding the solution if a large parameter space is given, specially for cases with more parameters or complex magnifications, e.g. binary lens.

@rpoleski
Copy link
Owner

rpoleski commented Sep 2, 2024

Generally, it looks OK. I have minor comments listed below. The last item is most important and time consuming. If you don't want to work on it, then just make it illegal to combine UN and Cassan08 :)

  1. line 384 - Add new option at the end, so that existing codes that don't use kwargs are not broken
  2. line 561 - I don't get the comment - please correct the code or change comment.
  3. line 569 - Please make it defensive, i.e., make it work even if 'Ultranest' is provided instead of 'UltraNest'.
  4. line 646 - Spelling to be corrected.
  5. line 647 - Why cython?
  6. lines 1364-1379 - I don't get it. Seems for me that settings should be a copy of an existing dict because it's changed at the end.
  7. line 2567 - For me looks like a feature that is not documented at the top of the class.
  8. line 2656 - Yes, there should be a check: if the parameterization is based on Cassan08 then the parameters should correspond to existing trajectory (i.e., both crossings are on the same caustic).

Note to @rpoleski - the last item shows that condition in line 2597 should be corrected.

@rpoleski
Copy link
Owner

rpoleski commented Sep 2, 2024

I've relaized that nobody complaint about this code failing on Cassan08 with MultiNest so solving item no. 8 and note below it is an additional ehancement, not a requirement.

@rpoleski
Copy link
Owner

rpoleski commented Sep 5, 2024

  1. In yaml file and in the code you added source_flux and blending_flux as derived parameters. First, it's meaning is clear only for single dataset cases. Second, it's different than flux_s_1 and flux_b_1 used in this code currently. Hence, please change the labels to flux_X_N.

@rapoliveira
Copy link
Contributor Author

@rpoleski Just a note that I will implement the prior in UltraNest this week, before the merge.

@rpoleski
Copy link
Owner

  1. I've looked at the code once more and see that if "x_caustic_in" in self._model.parameters.parameters properly checks for Cassan08 parameterization so there is no need to change that part of the code.

@rpoleski
Copy link
Owner

One remaining aspect - do we need _transform_unit_cube_UltraNest() or it's enough to call _transform_unit_cube() when using both MN and UN?

@rapoliveira
Copy link
Contributor Author

rapoliveira commented Sep 17, 2024

@rpoleski my last five commits include:

  • single transform function for MultiNest and UltraNest
  • implemented priors for UltraNest: negative_blending_flux_sigma_mag and t_E
  • Minor fixes (np.append in loop, parse posterior error, yaml files)
  • Separate function to check UltraNest inputs, including the names of the derived parameters. This last one required to call self._parse_fitting_parameters() after self._event is created. I checked that it doesn't affect the results of any examples

Please let me know if I missed anything from our discussions.

@rpoleski rpoleski merged commit d9e8119 into rpoleski:master Sep 22, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants