Hi,
how is it possible to distinguish whether a parameter of a TF1
is fixed to 0 or it doesn’t have limits on that parameter at all? Both methods TF1::FixParameter(i,0)
and TF1::ReleaseParameter(i)
lead to lmin == lmax == 0.0
when calling TF1::GetParLimits(i, lmin, lmax)
. I wasn’t able to find another method in the interface of TF1 about par limits.
In HFitImpl.cxx
line 264 I found a comment saying // this is a limitation - cannot fix a parameter to zero value
. Is this the case?
I also noticed that parameter limits on automatic functions like gaus(0)
seem to be ignored. This example
TH1F h1("h1","",100,-5,5);
h1.FillRandom("gaus",10000);
TF1 f1("f1","gaus(0)",-5,5);
f1.FixParameter(1,0.1);
h1.Fit("f1");
gives the output
EXT PARAMETER STEP FIRST
NO. NAME VALUE ERROR SIZE DERIVATIVE
1 Constant 4.00101e+02 4.88023e+00 1.58450e-02 4.82959e-05
2 Mean -1.20600e-02 fixed
3 Sigma 9.91531e-01 6.94493e-03 7.54781e-06 1.08163e-01
which is sort of funny, since ROOT still reports that parameter 1 (Mean) is fixed. Using a non-automatic function instead
TF1 f1("f1","[0]*TMath::Gaus(x,[1],[2]),-5,5);
f1.SetParameters(1,0,1);
f1.FixParameter(1,0);
obeys the fixed parameter setting
1 p0 3.99512e+02 4.89352e+00 1.48596e-02 -1.17658e-04
2 p1 0.00000e+00 fixed
3 p2 9.93449e-01 7.02990e-03 2.13445e-05 -9.73509e-02
I’m confused now.
Best regards and thanks,
Klaus
Please read tips for efficient and successful posting and posting code
ROOT Version: 6.22/06
Platform: Not Provided
Compiler: Not Provided