-
Notifications
You must be signed in to change notification settings - Fork 7
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
Error in TS calculation of StandardLLH #237
Comments
Hi, I think the thing is that implicitly it is assumed that each neutrino can only be coincident with one source, i.e. that the distances between the sources are larger than the angular uncertainties. So that when a neutrino is close to one source it will be far away from any other source and the spatial PDF will be non-zero only for the close source. That means that each element of y in L976 is already the sum over all sources for each event. It's just that the sum has only one summand. However, when going through this I think there should be an extra term in L976. With $$
Now assume that for each neutrino event and we get How the code is now I think it only calculates so I wonder if the |
Thinking about what that means for past results I don't think it changes anything. Still, we should change this. Talking to @robertdstein I think adding |
Hello Flarestack Devs,
In
flarestack.llh.StandardLLH.calculate_test_statistic()
I believe that there may be an error in the TS calculation. Specifically, the order of summation over sources & events may be reversed. For convenience, I am looking at L919--990.Below I have used some of the notation from Eqs. 2 & 5 of ICRC2021_1116. I have also attached an expression for a floating
n_s
TS based on Eq. 6 of the ICRC proceeding.What Flarestack is doing:
M
sources...n_coinc > 0
coincident events for a sourcej
, the SoB ratio terms for all coincident events of sourcej
are computed. I assume this is to save computational effort.x
.x
will have lengthM
after all sources have been iterated over, but each element ofx
may have different length.y
of listx
is first element-wise logged and then summed. Since each element has shape corresponding ton_coinc
, these operations are performed over all coincident events for source. Then, a sum is taken over all sources.I believe the error is at L976. To attempt to rephrase what I think flarestack is doing: It first takes the log of all
n_coinc
events' SoB ratio terms for a particular sourcej
, sums them, and then sums over all sources.Shouldn't the innermost sum be over sources, inside the log? That is to say, shouldn't flarestack first sum over all m sources' SoB ratio term for a particular event
i
, take the log, and sum over allN
events.Please let me know if you have any further questions, want clarification, or if there's something that I've missed.
The text was updated successfully, but these errors were encountered: