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

Ranking plot parameter order: max impact rather than average impact? #372

Closed lhenkelm closed 1 year ago

lhenkelm commented 1 year ago

The ordering of parameters in cabinetry.visualize.ranking sorts parameters by the average post-fit up- and down- impact. IMO a more natural/useful ordering is greatest post-fit impact in whichever direction (i.e. np.maximum(np.abs(postfit_up), np.abs(postfit_down))), since unlike the average, this corresponds to a potential fit behavior (pulling the parameter significantly in a given direction). Ofc. for many cases there should be basically no difference. But in the cases where it does make a difference (parameters with very asymmetric/one-sided impact) these "weird" parameters are sorted lower by the average impact & could even be hidden when also using max_parameters.

OTOH I noticed that cabinetry.visualize.plot_result.ranking already uses the max for axis limits, so is there maybe a reason to use the avg. when sorting?

alexander-held commented 1 year ago

Hi @lhenkelm, I agree that an ordering by the maximum impact in either direction makes more sense here for the reasons you mention. The max is used for the visualization range just to ensure nothing exceeds the axis range.

Feel free to submit a PR changing the ordering if you'd like, otherwise I can also take care of it.