Negative fit result codes and Print() in case of failed fit

I am experimenting with ROOT::Fit::Fitter etc. and analyticaly specifing function gradients.

Sometimes my fit converges and sometimes it fails, returning status code -2. I found that:

“The fitResult is negative in case of an error not connected with the fit.”

however, I have no idea what exactly the code means and why the fit fails. Could anyone tell me what the code means or where to find interpretations for negative status codes?

Other question is: can I force ROOT::Fit::Fitter::FitResult::Print() to print fit results even if FitResult.IsValid() is negative? Standard fiting (like TH1::Fit()) prints results even for failed fits…

Hi,

normally you should get a positive number (at least in the case of Minuit)
However, the status code depends actually on the minimizer you are using.
Which one are you currently using ?

Concerning FitResult::Print() out in case of an invalid result, this is currently not possible, but you can of course retrieve all the information you need from the class. But you are right, I will add the possibility to print the information also in the case of failed fits.
Thanks for your report

Lorenzo

[quote]normally you should get a positive number (at least in the case of Minuit)
However, the status code depends actually on the minimizer you are using.
Which one are you currently using ? [/quote]

I got -2 and -3 codes with Fumili. Currently I didn’t reproduce failure with Minuit, but I am working on it…

[quote]Concerning FitResult::Print() out in case of an invalid result, this is currently not possible, but you can of course retrieve all the information you need from the class. But you are right, I will add the possibility to print the information also in the case of failed fits.
Thanks for your report [/quote]

Yes, I retrieve informations manually, but working Print() would be easier.

Other thing is that I always get Ncalls=0, even if fit converges.

Hi

you get negative error code in Fumili:
(from root.cern.ch/root/htmldoc/TFumil … i:Minimize)

You should not get NCalls = 0 if you are using the latest version. I would need a running example probably to understand this

Regards

Lorenzo