-
Notifications
You must be signed in to change notification settings - Fork 268
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
Stabilize muon intensity fit #2425
base: main
Are you sure you want to change the base?
Conversation
If this fixes the numerical issue that was the root cause, why not? |
ctapipe/image/pixel_likelihood.py
Outdated
return np.sum(neg_log_l) | ||
# neg_log_l provides the variable term, add constants here to only | ||
# compute them once | ||
return 0.5 * (len(neg_log_l) * np.log(2 * np.pi) + np.sum(neg_log_l)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
log(2π)
could be a global constant.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, do we gain something by putting an njit
on this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tried, this actually resulted in a slower computation time in my tests. Probably due this function only using basic numpy functions and thus already being vectorized,
Docs builds failure is fixed in main, please rebase |
3aba5fd
to
0ee20bb
Compare
See #2415
The cause of this issue might be that the likelihood values grow quite large and thus minuit does not converge properly as the values leave the [0, 1]-range by several orders of magnitude.
@maxnoe suggested to divide the likelihood used by the dof to lower the value. The likelihood is constructed to asymptotically resemble a chi2 so this changes the approach to chi2 per dof which does not change the minimum.
This does, ofc., not make the test more robust in any way.