Function must be minimized before calling minos

i haven’t got to say… :slight_smile: Root doesn’t do fit
fit_mn_NBD_Ec.c (2.42 KB)

Instead of

gr2->Fit("nb1","EQMRL+","elp"); do

gr2->Fit("nb1","R","elp");
and you must specify initial values for your parameters.

Rene

it still doesn’t work.

To save time to you and me please post the shortest possible RUNNING script reproducing your problem.

Rene

excuse me,i sent script in first message. i followed your advice and change options, but it doesn’t help.
fit_mn_NBD_Ec.c (2.03 KB)

I suggest to print the values of the various Functions Gamma, etc in your function NBD to see what is the problem.

Rene

the problem is in the Root message: function must be minimizid before calling minos. what does it mean? thank you for response.

It means you cannot use MINOS before having found the minimum.
Probably your minimization did not converge.

I see your function overflow.
I would do the operation using the log of your function, with TMath::LnGamma instead of Gamma and not using TMath::Power.
In this way you minimize the risk of numerical overflows.

Lorenzo

Ok. Let’s not use Minos at all. That message vanish. But fit curve still is not drawn by Root. Maybe problem in fit points and NBD not lead here?