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*(TMath::Power((TMath::Power((par - x), 2)*1.0/TMath::Power((par), 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 = 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.
test.dat (1.14 KB)
simpleFit.C (6.5 KB)
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.