Varying fit results

Hi,

I’m getting weird results from fitting with the newer root versions. It seems like fitting one histogram twice (but resetting the fit parameters in between) yields different results.
I’ve noticed this behaviour in 5.22d and 5.24 but not in 5.22a.
Can anybody reproduce this? I’ve attached a short script to show this as well as the results for the different root versions. The first pad shows the result of the first fit (using a clone of the original histogram), the second the result of fitting the original histogram a second time, the third the fit of a clone of the original histogram (beofre it was fitted at all) and the fourth shows the fit of a clone of the original histogram (after the first fit). So the first and the third are fitted once and the second and the fourth are fitted twice (always with the same starting parameters) with varying results.

Vinzenz







test.c (790 Bytes)

Hi,

your fit is very sensible to the initial parameters of the fit and I think also the step sizes. The difference behavior in the release is explained from the fact that something has changed in the code on the default step size given in the first fit. Afterwards each fit result will depend on the step sizes obtained in the first fit.
If you do before fitting:

double errs[] = {0,0,0,0,0};
func->SetParErrors(errs);

you will get always the same result

Lorenzo

Thanks for the info! I’ve already suspected that something is kept from the previous fit but I didn’t realize that it’s the step size.