LeWhoo
June 23, 2009, 1:44pm
1
I cannot find an answer in this form or in any of the examples:
Is there any way to set a step size while performing simple TH2 fitting? In FitPanel there is a “step” field for each parameter, but if I correctly understand the sources, this is only used for setting minimum and maximum for the parameter…
moneta
June 23, 2009, 3:43pm
2
Hello,
step size can be set by using either the fit panel or by setting directly in TF1 via TF1::SetParError or TF1::SetParErrors.
If the value set is zero, a default step size will be used (typically 10% of the parameter value)
Best Regards
Lorenzo
LeWhoo
June 23, 2009, 3:56pm
3
That’s what I tried at the beginning:
psf_fun->SetParameters(1, 1, 18, 18.4, -1.17536e-02, -2.95840e-02, 9.05276e-03,1.52569e-02, 2.51531e-03);
psf_fun->SetParError(1, 10);
prof->Fit(psf_fun, "W");
Then I get:
FCN=366.649 FROM MIGRAD STATUS=CONVERGED 75 CALLS 76 TOTAL
EDM=0 STRATEGY= 1 ERROR MATRIX UNCERTAINTY 100.0 per cent
EXT PARAMETER APPROXIMATE STEP FIRST
NO. NAME VALUE ERROR SIZE DERIVATIVE
1 p0 1.00000e+00 1.41421e+00 0.00000e+00 0.00000e+00
2 p1 1.00000e+00 1.41421e+00 0.00000e+00 0.00000e+00
the displayed step size is 0, and during the fit I can see that it starts changing the p1 by 0.3, not by 10 as I requested…
I’ll try to create a working example soon.
LeWhoo
June 23, 2009, 4:11pm
4
OK, the modified tutorial example.
The line
f2->SetParError(0, 0.01);
does not seem to have any effect on the step size…
fit2.C (1.37 KB)
moneta
June 23, 2009, 4:18pm
5
Hi,
you can see the initail step size only if you use the verbose option (“V”).
Here is what I get by turning on this option
**********
** 1 **SET PRINT 2
**********
PARAMETER DEFINITIONS:
NO. NAME VALUE STEP SIZE LIMITS
1 p0 4.00000e+02 1.00000e-02 no limits
2 p1 -3.00000e+00 9.00000e-01 no limits
3 p2 3.00000e+00 9.00000e-01 no limits
4 p3 -3.00000e+00 9.00000e-01 no limits
5 p4 3.00000e+00 9.00000e-01 no limits
so you have 0.01 as expected.
However, which ROOT version are you using ? Maybe with aversion earlier than 5.22, this probably did not work
Lorenzo
LeWhoo
June 23, 2009, 4:25pm
6
I’ve got root 5.22/00. Here is my output :
root [0] .x fit2.C
100
400
**********
** 1 **SET PRINT 2
**********
PARAMETER DEFINITIONS:
NO. NAME VALUE STEP SIZE LIMITS
1 p0 4.00000e+02 1.20000e+02 no limits
2 p1 -3.00000e+00 9.00000e-01 no limits
3 p2 3.00000e+00 9.00000e-01 no limits
4 p3 -3.00000e+00 9.00000e-01 no limits
5 p4 3.00000e+00 9.00000e-01 no limits
So obviously something is not working. Maybe I should update…
LeWhoo
June 23, 2009, 5:38pm
7
OK, after update the error changes the step size. However, the initial step size is not the real step size - just proportional. Is that intentional?
1 p0 0.00000e+00 1.00000e+00
2 p1 0.00000e+00 1.00000e+00
and than first changes of those parameters are:
0.01 0
-0.01 0
0.1 0
-0.1 0