-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add autoscan for upper limit using TOMS Algorithm 748 (#1274)
* Add pyhf.infer.intervals and pyhf.infer.intervals.upper_limits modules. * Migrate pyhf.infer.intervals.upperlimit to pyhf.infer.intervals.upper_limits.upper_limit. * Add pyhf.infer.intervals.upper_limits.toms748_scan to API which implements the SciPy TOMS748 root finding method to scan for the upper limit. * Add pyhf.infer.intervals.upper_limits.linear_grid_scan to preserve the linear scan of the old pyhf.infer.intervals.upperlimit API in a specific API. * Use pyhf.infer.intervals.upper_limits.toms748_scan as the default method of scanning for and upper limit in pyhf.infer.intervals.upper_limits.upper_limit. * Update lower bound of the supported scipy versions to v1.2.0 to use scipy.optimize.toms748. * Add tests for the pyhf.infer.intervals.upper_limits.toms748_scan API and the behavior changes in pyhf.infer.intervals.upper_limits.upper_limit. * Add 'Confidence Intervals' section to the API docs and move the pyhf.infer.intervals.upper_limits APIs there. * Add a deprecation warning to pyhf.infer.intervals.upperlimit and note it is scheduled for removal in pyhf v0.9.0. * Add Beojan Stanislaus to contributors list. Co-authored-by: Matthew Feickert <matthew.feickert@cern.ch>
- Loading branch information
1 parent
749b9f7
commit 0ae9b0e
Showing
12 changed files
with
476 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,3 +29,4 @@ Contributors include: | |
- Aryan Roy | ||
- Jerry Ling | ||
- Nathan Simpson | ||
- Beojan Stanislaus |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
"""Interval estimation""" | ||
import pyhf.infer.intervals.upper_limits | ||
|
||
__all__ = ["upper_limits.upper_limit"] | ||
|
||
|
||
def __dir__(): | ||
return __all__ | ||
|
||
|
||
def upperlimit( | ||
data, model, scan=None, level=0.05, return_results=False, **hypotest_kwargs | ||
): | ||
""" | ||
.. deprecated:: 0.7.0 | ||
Use :func:`~pyhf.infer.intervals.upper_limits.upper_limit` instead. | ||
.. warning:: :func:`~pyhf.infer.intervals.upperlimit` will be removed in | ||
``pyhf`` ``v0.9.0``. | ||
""" | ||
from pyhf.exceptions import _deprecated_api_warning | ||
|
||
_deprecated_api_warning( | ||
"pyhf.infer.intervals.upperlimit", | ||
"pyhf.infer.intervals.upper_limits.upper_limit", | ||
"0.7.0", | ||
"0.9.0", | ||
) | ||
return pyhf.infer.intervals.upper_limits.upper_limit( | ||
data, model, scan, level, return_results, **hypotest_kwargs | ||
) |
Oops, something went wrong.