feat: Improve handling of parameter bounds when computing impacts in ranking #512
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is based on #490.
Summary
When building parameter rankings based on impact, 5 fits must be evaluated for each NP. The fits are evaluated at:
The uncertainties so far have been extracted from the Hessian. If the bounds of the parameter, which specify valid range of values of this parameter, are not specified by the user, one of the NP values above may step out of the appropriate bound. For example, for a poisson-constrained NP (
shapesys
). If the best-fit value is1.0
and pre/post-fit uncertainty is>1
, the NP value will be negative for some of the above fits. Negative parameter values are not allowed in the poisson terms, and hence the corresponding fits fails.This can indicate a defective model, or it can be the result of the Hessian uncertainty being symmetrised without respecting parameter bounds. If the user is sure their model is good, some options are added in this PR to help the firs converge:
1- Use suggested bounds from
pyhf
to force the ranking to cap the value of an NP at its physical limit, independently of the uncertainty extracted from the fit.2- Use the uncertainty from MINOS on the NP which will respect the parameter boundaries by construction.
In this MR, an option to the
fit.ranking
function is added to specify that suggested bounds should be used to set limits on the parameters bounds are not set by user. In addition, the ranking function can now read MINOS uncertainties for relevant parameters if the fit results are provided to it. If the fit results are not provided, the ranking function can now perform the fit itself while allowing the use of MINOS for model parameters.Example spec
The following spec fails even for pre-fit uncertainties.
With this PR the following setups are possible, utilising suggested bounds:
To utilise MINOS, consider the following setup: