Wrong parameters determination with simpleFit.C

Dear RootTalk,
I’m using simpleFit.C to fit a function. I’m testing this program with simple functions and everything works perfectly.
Now, I need to use simpleFit for a more complex function
f = par[2]*(TMath::Power((TMath::Power((par[0] - x), 2)*1.0/TMath::Power((par[1]), 2) +1 ), -0.5));
and simplefit gives me wrong parameters. I thought at first that the probleme come from the divide by 0 if par[1] = 0. I’m imposing a non-zero condition but it’s not the problem, the parameters are wrong.
I send you my code and my datas if somebody have an idea.
Thank you very much.
maximilien
test.dat (1.14 KB)
simpleFit.C (6.5 KB)

HI,

You need to provide reasanable initial parameter values to make the fit working. The values should be closer to the solution as possible. I see that the chi2 evaluates to infinity, so it means the initial provided values do not make sense.

Best Regards

Lorenzo