Skip to content

Commit

Permalink
limit NP variations in rankings to be within bounds
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-held committed Oct 22, 2024
1 parent 8f78894 commit 0dd65b9
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/cabinetry/fit/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -613,6 +613,13 @@ def ranking(
log.debug(f"impact of {label} is zero, skipping fit")
parameter_impacts.append(0.0)
else:
par_bounds = par_bounds or [
tuple(bound) for bound in model.config.suggested_bounds()
]
if not par_bounds[i_par][0] <= np_val <= par_bounds[i_par][1]:
np_val = min(
max(np_val, par_bounds[i_par][0]), par_bounds[i_par][1]
)
init_pars_ranking = init_pars.copy()
init_pars_ranking[i_par] = np_val # value of current nuisance parameter
fit_results_ranking = _fit_model(
Expand Down

0 comments on commit 0dd65b9

Please sign in to comment.