Dear all.
I had a problem with warning when fitting histograms.
Following warning, which was not shown with v5.20, is shown during fitting with v5.22 (or SVN-version rev.27508).
MINUIT WARNING IN PARAMETR
============== VARIABLE2 BROUGHT BACK INSIDE LIMITS.
I asked if there is a way to suppress the warning in support forum.
root.cern.ch/phpBB2/viewtopic.php?t=8028
Thanks to a help, the problem was solved for me by modifying source code of ROOT locally by hand.
But I wonder if some modification could be done for ROOT distribution.
I had look into code, and it seems to me that the warning is shown when ranges and initial values of fitting parameters are set. So, the warning is independent of implementation of fitting function.
I confirmed that the warning is shown before fitting function is called.
So, it seems that the condition of warning simply depends on range and initial value of a parameter.
For example, following fitting shows the warning.
When I change “offset” to smaller value like 10, the warning disappear.
(This fitting is just an example to reproduce the problem.)
Double_t offset = 1000;
TH1F hist("hist", "hist", 100, -50 + offset, 50 + offset);
Int_t i;
for (i = 0; i < 10000; i++) {
hist.Fill(gRandom->Gaus(offset, 3));
}
TF1 f1("f1", "gaus", -50 + offset, 50 + offset);
f1.SetParameters(1300, offset, 3);
f1.SetParLimits(1, -50 + offset, 50 + offset);
f1.SetParError(1, 1);
hist.Fit("f1", "Q", "", -50 + offset, 50 + offset);
As far as I understand the code, during setting parameters, a fitter sets initial step size based on the initial value (maybe proportional to the initial value). A minimizer shows the warning if “initial” + “step” is outside of parameter limits.
So, it seems to me that the warning is not under control of users.
It would be nice if some modification is done for the ROOT distribution.
A possible modification could be one of followings.
- Suppress the warning when ‘Q’ option is used.
- Allow users to set step size for the check.
- Set step size more intelligently with taking into account parameter range.
I personally want the modification to be included in the next patch release of v5.22, if possible, because our collaboration is going to use the version as a standard for the next one year.
Best regards.
Ryu