Fit instability due to entering negative region

Hello Lorenzo!

Thank you for devoting time to my question.

Yes, I am using ROOT v6.26. To complete the puzzle and a status of my problem, I would like to mention two more things:

  1. In the meantime, while I was looking for a solution, I’ve found the following thread very useful:
    Roofit upper limit unstable for negative pdf (with AsymptoticCalculator)
    Here an author is experiencing a similar problem while doing a different study. I’ve gone through the suggested solutions, but none of them really worked. Neither assigning wiser ranges for floating parameters, nor the EvalErrorWall(false) flag for fitting could do a trick.

  2. I also tried to get rid of the problematic fits by checking the MINUIT status. In particular, I required fitres.status()==0. I additionally tested fitres.covQual()==2 (although I could not find explanation of the possible values of this flag and corresponding meanings, I came up to the value 2 empirically). Eventually, status() did improve the situation a bit, now much fewer failed fits are passing through this criterion. But, as you can see from the randomly-chosen fits below, there are still cases with skyrocketing fits.

Summarizing my experience, the suggestions I’ve found while digging were not performing well. Hence, I’d like to ask:

  1. Is there any other idea I could try?
  2. Is there any other criterion that could efficiently reject all the failed fits and to leave only good ones?

In the meantime, I will try to test a RooBernstein class that you suggested.

Thank you and looking forward to hearing from you.
Dmytro.