-
Notifications
You must be signed in to change notification settings - Fork 85
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
feat: Add discovery p0 test statistic #1232
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1232 +/- ##
==========================================
+ Coverage 97.47% 97.48% +0.01%
==========================================
Files 63 63
Lines 3716 3733 +17
Branches 525 530 +5
==========================================
+ Hits 3622 3639 +17
Misses 55 55
Partials 39 39
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
02b8cbc
to
fa85220
Compare
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.
@kratsg overall this looks really good but let me think a bit more about the questions you raise in the PR body. Also for adding new binaries like validation/multibin_histfactory_p0/data/data.root
for validation, do we want to add more binaires to the repo? Or should we have these added to scikit-hep-testdata?
2b67a8a
to
c9140c3
Compare
I think we should add them to this repo for now. If we then decide to migrate later -- we should. But we should start considering using |
34c903d
to
7dda900
Compare
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.
@kratsg Thanks a lot for this pretty critical PR. 👍
Technically everything looks good I think. Though I agree that we should probably take this opportunity to consider the terminology and the APIs to try and make things as clear as possible. So tagging @lukasheinrich and @alexander-held here for additional comments and thoughts.
Yeah they're all told only a few kB so I think it is fine. Though at the same time I wouldn't be against doing on-the-fly generation here. |
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.
Thanks for all the work on this! I tried out the API yesterday, it was straightforward to adopt and in agreement with a ROOT reference for the examples tested.
I do not have any immediate suggestions for naming, but think that the naming inside hypotest
may in the long term be difficult to read. @kratsg's idea of alternative/null sounds like it could work (maybe with extra comments calling things by their name in the respective branches in the function?).
validation/multibin_histfactory_p0/results/example_results.table
Outdated
Show resolved
Hide resolved
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.
@kratsg Once jax-ml/jax#5374 is resolved and @lukasheinrich reviews then I think this can go in, given that you've made dedicated followup PRs or Issues for most of my revision requests. Can you take care of the
Summarize commit messages into a comprehensive review of the PR
though?
The complexity of the fixtures in |
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.
LGTM now
I have ideas on how to simplify it. Validation is very tricky to do, but I have a good idea of how to refactor it into something slightly more maintainble. |
Co-authored-by: Matthew Feickert <[email protected]>
41eda33
to
1f64782
Compare
Description
Supersedes #520. Particularly it's just a full reimplementation of @nikoladze 's work but on top of more recent
pyhf
master. I initially tried to rebase, but there's been a lot of changes in theinfer
API that I felt it was better to pick out all the pieces, and re-implement it accordingly.To-Do:
how to handle-- see feat: Cleanup internal names for hypotest #1247poi_test
gracefully? Shouldq0
simply warn and setpoi_test
or should we fail harder?hypotest
should handle more gracefully, but the calculators should nothow to handle-- see feat: Cleanup internal names for hypotest #1247asimov_mu
gracefully? Shouldhypotest
orAsymptoticCalculator
check ifasimov_mu
is consistent with the test statistic being used? Should the test statistic functions have afunc.default_asimov_mu
attribute?what to name all the various "p-values" returned via hypotest? (can't reasonably call it CLs or w/e) [related discussion: feat: customizable metrics in hypotest #966]-- see feat: Cleanup internal names for hypotest #1247should-- see feat: Cleanup internal names for hypotest #1247AsymptoticCalculator
return ab_only_distribution
forq0
(what is this? we're very stuck on signal/background namings here)Idea: change
poi_test
toalternative_mu
(alt_mu
) andasimov_mu
tonull_mu
. This perhaps clarifies the meaning of the testing at least. Then we need to have toys to support these distributions. Then maybe change fromsignal_plus_b
toalternative_distribution
andb_only
tonull_distribution
?ReadTheDocs build: https://pyhf.readthedocs.io/en/feat-discoveryteststat/_generated/pyhf.infer.test_statistics.q0.html
Closes #520
Checklist Before Requesting Reviewer
Before Merging
For the PR Assignees: