scikit-hep / cabinetry

design and steer profile likelihood fits
https://cabinetry.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
26 stars 21 forks source link

Handle partially fixed parameters in `model_utils` API #390

Closed alexander-held closed 1 year ago

alexander-held commented 1 year ago

The support for partially fixed parameters (such as staterror with zeros in some bins) in pyhf 0.7 can result in scenarios where the behavior of suggested_fixed_as_bool is undefined, see https://github.com/scikit-hep/pyhf/issues/1944.

This currently breaks model_utils.prefit_uncertainties in cabinetry (and also affects model_utils.unconstrained_parameter_count). Working around this should be possible by iterating bin by bin for affected parameters and using the suggested_fixed API instead.

alexander-held commented 1 year ago

model_utils.prefit_uncertainties can be fixed by using the suggested_fixed API. model_utils.unconstrained_parameter_count is not affected by constrained parameters, but needs in principle to be able to handle shapefactor modifiers that are partially fixed. This is not currently supported by pyhf on a workspace specification level (https://github.com/scikit-hep/pyhf/issues/2053), but it would be good to already implement this in cabinetry such that it automatically works if support arrives in pyhf.