Parameter bounds affect fits with fixed parameters
See original GitHub issueDescription
See this example:
import pyhf
spec = {
"channels": [
{
"name": "SR",
"samples": [
{
"data": [10.0],
"modifiers": [
{"data": None, "name": "Signal_norm", "type": "normfactor"}
],
"name": "Signal",
},
{"data": [50.0], "modifiers": [], "name": "Background"},
],
}
],
"measurements": [
{
"config": {
"parameters": [
{"bounds": [[0, 5]], "inits": [2.0], "name": "Signal_norm"}
],
"poi": "Signal_norm",
},
"name": "minimal_example",
}
],
"observations": [{"data": [65.0], "name": "SR"}],
"version": "1.0.0",
}
ws = pyhf.Workspace(spec)
model = ws.model()
data = ws.data(model)
# pyhf.infer.hypotest(6.0, data, model, qtilde=True) # this fails
pyhf.set_backend("numpy", pyhf.optimize.minuit_optimizer(verbose=False))
# the next two work, but result in identical values
print(pyhf.infer.hypotest(6.0, data, model, qtilde=True))
print(pyhf.infer.hypotest(7.0, data, model, qtilde=True))
The CLs value reported in the last two lines is identical. This seems to be related to the parameter bounds [0,5]. When increasing the range, the CLs values are different (as expected).
When uncommenting the first hypotest (using scipy), the minimization fails:
pyhf.exceptions.FailedMinimization: Positive directional derivative for linesearch
Expected Behavior
All fits succeed, and different CLs for any POI value. If the bounds are somehow still respected, a warning about parameters being outside the bounds (and scaled back to the bound) would be helpful.
Actual Behavior
Same CLs for POI values above bound, and scipy backend crashes.
Steps to Reproduce
See above, same behavior with 0.5.2 and master.
Checklist
- Run
git fetchto get the most up to date version ofmaster - Searched through existing Issues to confirm this is not a duplicate issue
- Filled out the Description, Expected Behavior, Actual Behavior, and Steps to Reproduce sections above or have edited/removed them in a way that fully describes the issue
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Parameters - Bumps 0.9.0 documentation
Bumps fitting is centered on Parameter objects. Parameters define the search space, the uncertainty analysis and even the user interface.
Read more >scipy - Fitting only one parameter of a function with many ...
The newly created function accepts only two arguments: x and a , whereas b is fixed to the value taken from the local...
Read more >Bounded parameter distribution - Monolix - Lixoft
Bounded parameters in the interface. Starting from the 2019 version, it is possible to “extend” the logit distribution to be bounded in [a,...
Read more >Parameter and Parameters - lmfit
A Parameter has a value that can either be varied in the fit or held at a fixed value, and can have lower...
Read more >12.2. Parameters — xraylarch 0.9.51 documentation - CARS
During a fit, a Parameter's value may approach or even equal one of the bounds, but will never violate the boundary. It should...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I’ve verified that the example from @alexander-held fails with a more interpretable error msg for all three cases in #1126 and once you adjust the bounds the CLs values behave as expected
@lukasheinrich this is great. I think we can say that PR #1126 fully addresses this Issue then.