MINUIT: How to access directly fit/covariance results?


I perform a fit directly with MINUIT (i.e. minimizing my own LogLikelihood).
For some further processing I would like to access the fit results (i.e. parameter values and corresponding covariance matrix elements).

In the MINUIT documentation I found mnmatu, which prints the covariance matrix. But I found no functions that return the parameters’ fit results or their covariance matrix elements as floats or so.

From the ROOT interface to MINUIT I know that I can get the fit results with
etc. – so I guess that it should be possible to get the values directly from MINUIT, or?

Cheers & Thanks for any advice,

Use TMinuit::mnemat,

From TVirtualfitter, you can use

Double_t *TFitter::GetCovarianceMatrix() const
and see its implementation at:
root.cern.ch/root/html/src/TFitt … html#XiOOX



you can use the function TMinuit::mnemat
see root.cern.ch/root/htmldoc/TMinui … uit:mnemat

and for easy access you could get the result in a TMatrix as follows

TMatrixDSym mat(npar); 
gMinuit->mnemat( mat->GetMatrixArray(), npar);


Thanks – mnemat is what I was looking for :slight_smile:

Just for curiosity: Can I use the ROOT ‘wrapper’ functions as TVirtualfitter when I perform a fit directly with MINUIT. So, TVirtualFitter also only gives an interface to the particular fit, right? Then I could recycle some of my previous code.

Cheers & Thanks – Thomas

Correct. The VirtualFitter provides an interface to the concrete fitter, eg TMinuit or minuit2