When I try to do the following, I get this error with 5.22, and I don’t remember this issue previously (ROOT ~5.21?). ROOT was compiled with: ./configure --enable-mathmore --enable-minuit2 --enable-gsl-shared
In [4]: f.h.Fit(thetaD,“LL I”)[/code]
When I do this, I just expect the fit output, but instead I get the following error hundreds of times, followed by the fit output:
Error in <GSLError>: Error 5 in qag.c at 261 : could not integrate function
the problem appears because some of the fit parameter gets crazy values
(nan). This is due because the fitting function is evaluated in region where this is negative and this is not possible in a likelihood fit.
A protection has been now added to the fitting to avoid this condition, however you should use a better fit function to fit your data.
Thank you for reporting this,
Yes, you can set the parameter limits or restrict eventually the fitting range to avoid that the function is evaluated as negative on the given bins.
In your particular case, the function definition you are providing is far from optimal. I would try with a different function, maybe using different type of polynomials.
I am just referring to fitting your histogram data with your function ( a simple parabola). The fit converges, but to values very far away from the data.
This is a feature of the ML fit. For this particular case, the fit gets the correct value of [0], even though it does not describe the data in bins exactly. (I know it’s a “bad-looking” fit, but I have done independent checks that it definitely does give the correct value).