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

fix: parameter uncertainties for partially fixed parameters #396

Closed alexander-held closed 1 year ago

alexander-held commented 1 year ago

In the presence of partially fixed parameters (currently this only happens for staterror modifiers that are constant in some bins due to zero yield + uncertainty, see https://github.com/scikit-hep/pyhf/issues/1944) the previously used model.config.suggested_fixed_as_bool will not work. Instead, model.config.suggested_fixed works fine to handle these mixed cases.

The same update is made for the counting of the number of unconstrained parameters. This should in principle correctly handle partially fixed shapefactor modifiers, however this currently cannot be achieved in pyhf (see https://github.com/scikit-hep/pyhf/issues/2053). This means the behavior currently cannot be tested.

resolves #390

* fix pre-fit parameter uncertainty evaluation for partially fixed parameters
* support unconstrained degree of freedom counting for partially fixed parameters
codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (67f7fd6) 100.00% compared to head (dbf630d) 100.00%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #396 +/- ## ========================================= Coverage 100.00% 100.00% ========================================= Files 23 23 Lines 2060 2059 -1 Branches 324 324 ========================================= - Hits 2060 2059 -1 ``` | [Impacted Files](https://codecov.io/gh/scikit-hep/cabinetry/pull/396?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=scikit-hep) | Coverage Δ | | |---|---|---| | [src/cabinetry/model\_utils.py](https://codecov.io/gh/scikit-hep/cabinetry/pull/396?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=scikit-hep#diff-c3JjL2NhYmluZXRyeS9tb2RlbF91dGlscy5weQ==) | `100.00% <100.00%> (ø)` | | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=scikit-hep). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=scikit-hep)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.