Re: [ROOT] Changing the ERRDEF parameter in MINUIT

From: Rene Brun (Rene.Brun@cern.ch)
Date: Mon Nov 24 2003 - 18:59:08 MET


Hi Stanislav,

See my answer on this subject at:

http://root.cern.ch/root/roottalk/roottalk03/5107.html

Rene Brun

Stanislav Nesterov wrote:
> 
>  Hi Alexander,
>   You are right in this case - if you look at TH1::Fit() code you'll see
> such lines:
> 
> //   - Set error criterion for chisquare or likelihood methods
> //   -  MINUIT ERRDEF should not be set to 0.5 in case of loglikelihood fit.
> //   -  because the FCN is already multiplied by 2 in H1FitLikelihood
> //   -  if Hoption.User is specified, assume that the user has already set
> //   -  his minimization function via SetFCN.
>    arglist[0] = 1;
>    if (Foption.Like) {
>       hFitter->SetFitMethod("H1FitLikelihood");
>    } else {
>       if (!Foption.User) hFitter->SetFitMethod("H1FitChisquare");
>    }
>    hFitter->ExecuteCommand("SET ERR",arglist,1);  ///
>    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 
>    So your efforts in setting MINUIT ERRDEF was for nothing. Sorry. I
> see the only solution is not to use the TH1::Fit() method or change the
> method itself
> 
>                                                           Best regards,
> 
>          Stanislav.
> 
> Alexander Dietz wrote:
> 
> >Hi,
> >
> >to change the ERRDEF-parameter in MINUIT I tried the following:
> >
> >  Double_t arglist[100];
> >
> >  TH1F* h1=new TH1F("h1","h1",3,1,4);
> >  h1->Fill(1,1);
> >  h1->Fill(2,2);
> >  h1->Fill(3,1);
> >  h1->Draw();
> >
> >  TVirtualFitter *hFitter = TVirtualFitter::Fitter(h1);
> >  h1->Fit("pol0");   // Fit 1
> >
> >  arglist[0]=1;
> >  hFitter->ExecuteCommand("SET ERR",arglist,0.7);
> >  gMinuit->SetErrorDef(0.7);
> >  h1->Fit("pol0");   // Fit 2
> >
> >
> >But both fits gave the same errors!
> >So how to change the ERRDEF -parameter?
> >
> >Alexander Dietz
> >
> >



This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:17 MET