Re: minimization different in ROOT4 and ROOT5

From: Rene Brun <Rene.Brun_at_cern.ch>
Date: Thu, 14 Sep 2006 17:58:20 +0200


Hi Luca,

You are unfortunatly using version 5.08 where the likelihood fit ignored bins with 0.
Versions 5.10,5.12 and 5.13 produce the same result as 4.04

Number of data: 2549 89.1222 25.743

 FCN=530.338 FROM MIGRAD    STATUS=CONVERGED      65 CALLS          66 TOTAL
                     EDM=2.13389e-10    STRATEGY= 1      ERROR MATRIX 
ACCURATE
  EXT PARAMETER                                   STEP         FIRST  
  NO.   NAME      VALUE            ERROR          SIZE      DERIVATIVE
   1  Rho          1.78512e+00   6.83244e-02   4.69665e-04  -2.69642e-04
   2 L.Y. (p.e./keV) 1.12079e+00 4.27042e-02 2.93564e-04 6.41069e-05
Threshold : 61.8316
1SCAN OF PARAMETER NO. 2, L.Y. (p.e./keV)  FCN=530.338 FROM SCAn STATUS= NO CHANGE 100 CALLS 166 TOTAL
                     EDM=2.13389e-10    STRATEGY= 1      ERROR MATRIX 
ACCURATE
  EXT PARAMETER                                   STEP         FIRST  
  NO.   NAME      VALUE            ERROR          SIZE      DERIVATIVE
   1  Rho          1.78512e+00   6.83244e-02   4.69665e-04  -2.69642e-04
   2 L.Y. (p.e./keV) 1.12079e+00 4.27042e-02 2.93564e-04 6.41069e-05

You will notice however a small difference in the first pass of the fit for the value of FCN.
The value in 5.10,5.12,5.13 is correct.

So, just move to 5.12 or 5.13

Rene Brun

Luca Grandi wrote:
> Hi all,
>
> I have got a problem with minimization using ROOT. I get slightly diffrenet
> results from ROOT 4 and ROOT 5.
>
> I wrote a script in which I define a histogram
>
> hf = new TH1F("hf", "Photoelectrons Spectrum", 200, 0., 1000.);
>
> I fill it
>
> hf->Fill(data[ev_count]);
>
> and then fit it with a function called "Linear"
>
> TF1 *f1 = new TF1("f1", Linear, 0., 1000., 2);
> f1->SetParameter(0, 1.);
> f1->SetParName(0, "Rho");
> f1->SetParameter(1, 1.);
> f1->SetParName(1, "L.Y. (p.e./keV)");
> c1->cd(1);
> hf->Fit("f1", "L", "", threshold, 1000.);
> hf->Draw("e");
>
> and "Linear" is
>
> Double_t Linear(Double_t *x, Double_t *par)
> {
> Double_t arg = 0;
> if (par[1] != 0) arg = x[0]/par[1];
> Double_t fitval = par[0]*dNdE(x[0]/par[1])/par[1];
> return fitval;
> }
>
> If I run it on ROOT 4 I get
>
> FCN=134.135 FROM MIGRAD STATUS=CONVERGED 65 CALLS 66
> TOTAL
> EDM=2.13358e-10 STRATEGY= 1 ERROR
> MATRIX ACCURATE
> EXT PARAMETER STEP FIRST
> NO. NAME VALUE ERROR SIZE DERIVATIVE
> 1 Rho 1.78512e+00 6.83244e-02 4.69665e-04 -2.69615e-04
> 2 L.Y. (p.e./keV) 1.12079e+00 4.27042e-02 2.93564e-04
> 6.41165e-05
>
> while if i run ROOT 5 I get
>
> FCN=493.398 FROM MIGRAD STATUS=CONVERGED 53 CALLS 54 TOTAL
> EDM=5.30182e-08 STRATEGY= 1 ERROR MATRIX
> ACCURATE
> EXT PARAMETER STEP FIRST
> NO. NAME VALUE ERROR SIZE DERIVATIVE
> 1 Rho 1.72045e+00 6.75899e-02 4.36268e-04 4.58320e-03
> 2 L.Y. (p.e./keV) 1.19107e+00 5.01150e-02 3.24074e-04
> 1.03245e-02
>
> The results are different as the FCN values. Any suggestion?
>
>
Received on Thu Sep 14 2006 - 17:58:27 MEST

This archive was generated by hypermail 2.2.0 : Mon Jan 01 2007 - 16:32:01 MET