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

Possible bug in Likelihood of Photosphere Everywhere with time_invariant=True #412

Open
ckazantsev opened this issue Nov 29, 2024 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@ckazantsev
Copy link
Collaborator

When running the likelihood estimator (likelihood.check) with Everywhere and time_invariant=True, different executions give different values of likelihood, either close to llzero or close to the true value of -1.8e3. Doing the exact same thing with time_invariant=False always gives the correct value.

@ckazantsev ckazantsev added the bug Something isn't working label Nov 29, 2024
@thjsal thjsal changed the title Possible bug in Likelihood of Photosphere Everwhere with time_invariant=True Possible bug in Likelihood of Photosphere Everywhere with time_invariant=True Nov 29, 2024
@thjsal
Copy link
Contributor

thjsal commented Nov 29, 2024

I guess there is a bug in the code causing sporadic failures. And the failure is likely captured by the error handling either here:

except xpsiError as e:

or here:
except xpsiError as e:

I suggest commenting out those except xpsiError as e conditions so that we will know where in the code the failure actually happens.

@thjsal
Copy link
Contributor

thjsal commented Nov 29, 2024

It could be a similar issue as here:
#53

@ckazantsev
Copy link
Collaborator Author

ckazantsev commented Dec 4, 2024

It seems to come from the default_background_marginalisation.pyx
https://github.com/xpsi-group/xpsi/blob/db1a05795d1e30ab4eb55ca3baa535b5a1266e16/xpsi/likelihoods/default_background_marginalisation.pyx#L397C1-L403C42
The function gsl_interp_eval_integ seems to sometimes be giving huge values that then get added to STAR, leading to a likelihood evaluation that is wrong.
One workaround would be to put a condition of len(phases)>2 to compute that function, and to just assign the component value if not ( STAR[i,j] = components[i][j] ), to deal with Everywhere and time_invariant=True where there is only one phase bin. But then using time_invariant = False leads to an error and needs to be solved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants