I have used ROOT and QTiplot to fit the same data set and I have found different results. I found out that the parameters fitted by ROOT were not optimal. Are there any tweaks that I could adjust to improve the fitting in ROOT?
Below is the code I used, I appreciate any comments and suggestions.
void fittings (char* file)
{
gStyle->SetOptStat(0);
gStyle->SetOptFit();
TGraphErrors* gd = new TGraphErrors (file);
TF1 *f1bi = new TF1("bimolecular","[0]/(pow([1]/x,[2])+1)", 0, 15);
f1bi->SetParameters(1., 13,0.8);
gd->Fit (f1bi, "RF");
gd->Draw("AP");
cout << "The reduced ChiĀ² is " << f1bi ->GetChisquare()/f1bi->GetNDF() << endl;
}
Thanks, but it did not help.
I checked all links and materials about it. I also run several example codes from the tutorial folder to understand how the minimizer works. I foound out that the following lines may have some impact on the Minuit2 but not in the Minuit
Strangely, everything other than the default parameters (including the Minuit choice over Minuit2) were worse.
I realize that the function I am trying to fit is challenging (f(x) = a/((b/x)^c+1)) but I expected that Minuit was able to fit the best parameters.
Is your graph having error in X? Maybe these are not correct and not included in the other packages.
Otherwise please post the root file with the TGraphError object, so we can loo, at it
And the only modification I made to the code above is that I dropped the X errors and replaced the TGraphErrors line by:
TGraphErrors* gd = new TGraphErrors (file, "%lg %lg %lg");
I did notice that the results are quite sensitive to the Y errors. If I reduce the errors in Y I get different results; with narrow error bars I get closer (but not the same) numbers to what I expect. I do understand that the minimizer should take the errors into account, however it seems to me that the minimizer is giving too much weigth for the errors.