Re: how to get covariance matrix from TMinuit ?

From: Rene Brun <Rene.Brun_at_cern.ch>
Date: Sun, 28 Jan 2007 08:02:16 +0100


X. Lu, Peking Univ. wrote:
> Hi rooters,
>
> Can somebody tell me how to get the covariance matrix after fitting
> with TMinuit ? It seems quiet difficult .
I believe that this is quite well documented. Did you really look at the documentation?

-if you call the virtual fitter, see:

   Double_t *TVirtualFitter::GetCovarianceMatrix() const = 0;    Double_t TVirtualFitter::GetCovarianceMatrixElement(Int_t i, Int_t j) const = 0;

-if you use TH1::Fit, see the description of this function

//      Access to the fit covariance matrix
//      ===================================
//      Example1:
//         TH1F h("h","test",100,-2,2);
//         h.FillRandom("gaus",1000);
//         h.Fit("gaus");
//         Double_t matrix[3][3];
//         gMinuit->mnemat(&matrix[0][0],3);
//      Example2:
//         TH1F h("h","test",100,-2,2);
//         h.FillRandom("gaus",1000);
//         h.Fit("gaus");
//         TVirtualFitter *fitter = TVirtualFitter::GetFitter();
//         TMatrixD matrix(npar,npar,fitter->GetCovarianceMatrix());
//         Double_t errorFirstPar = fitter->GetCovarianceMatrixElement(0,0);

-use Google and select "TMinuit covariance matrix"

-see also the lengthy explanations in
http://root.cern.ch/root/htmldoc/TMinuit.html

Rene Brun

>
> Thanks in advance !
>
> Best Regards,
> Xianguo
>
> --
> Take flight into the sky, beyond the moon, beyond my mind.
>
> Xianguo LU
> Physics Department, Peking University
> Beijing, China
> Tel: 0086-10-62753888(o)
Received on Sun Jan 28 2007 - 08:02:20 CET

This archive was generated by hypermail 2.2.0 : Sun Jan 28 2007 - 11:50:01 CET