-
Notifications
You must be signed in to change notification settings - Fork 421
Robust fit improvements #658
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 102x
Are you sure you want to change the base?
Conversation
|
The last commit also fixes a residual issue related to steep log-likelihood functions. It replaces the guess made between the present and the previous locations with a full quadratic interpolation based on the three closest points. The precision requirement is kept the same. |
|
Hi, I would like to understand better what the issues are before considering merging this PR. The robustFit algo is used heavily in CMS and any changes to the algorithm need to be carefully understood and validated (in general we recommend contacting the combine developers first if you encounter a problem like this). Anyway, the issue that "Robust fit fails to recognize convergence when the crossing point is on the order of the crossing tolerance" - could this be addressed by setting a more appropriate min/max on the parameter being scanned, or is the issue not as simple as that? It's true the algorithm may struggle if the range on the parameter is many orders of magnitude larger than the distance to the crossing. |
I don't think setting the min/max of the parameter manually is desirable if one runs several hundreds of jobs, which is the case I am dealing with. It is not a scalable solution. Moreover, as I mentioned, the last commit fixes an important bug, where the interpolation equation assumes certain properties that are not true in general (and I have come across cases where the interval is off by an order of magnitude, within the small uncertainty band it is supposed to have). The solution is tested well, comparison to Minos algorithm closes when Minos manages to succeed. |
|
BTW, the default behavior is almost exactly the same if one does not set FITTER_CROSSING_PERSISTENT_TRIALS, with the only meaningful change being in how the interpolation is done in the first if-condition inside the for-loop. |
|
Well I think setting sensible ranges on all floating parameters is good practice. This also helps minuit make reasonable initial steps at the start of the minimisation. If this is really a problem, then I guess you could also play with the stepSize or tolerance parameters to achieve a similar effect. It would be helpful to have more detail on the bug you mention though. Can you provide a minimal example that we can test? |
I agree with you in general, but it doesn't always work in practice because the different data cards I have to work with are also in different ranges (I am running some T&P fits using combine, so each bin has a different signal or bkg shape, or signal fraction). I put initial guesses on the central value and ranges, but I can't narrow the range finely enough. That is why I decided to improve the functionality of robustFit instead (I still have several hundreds of datacards, so tuning them by hand was becoming impractical). Let me upload an example workspace on lxplus and point to it in this thread. |
Here it is: |
|
Thanks, so I was able to get to (I think) the correct crossing in a fairly small number of steps using: which gives: But then indeed I see the issue with the interpolated value here. So that part should probably be fixed. At this point I'd prefer to apply a minimal fix for this algo (perhaps even just returning |
Thanks for looking at this issue. I still don't think this adjustment can be done in a general setting (since in the case of these workspaces, the minimum and range of frac_sig could be quite different, and there are as many as 100K of them according to my last count), but for sure I could wait until a discussion with other developers happens first. |
Robust fit fails to recognize convergence when the crossing point is on the order of the crossing tolerance. In such cases, the POI approaches close enough in nll to the specified level, but what is returned is still NaN. This PR fixes this issue. It also introduces the runtime define 'FITTER_CROSSING_PERSISTENT_TRIALS'; if this value is >0, the crossing minimizations continue until 'FITTER_CROSSING_PERSISTENT_TRIALS'-many trials are conducted.