How to get correlation matrix for fit?


is there a simple way to get the correlation matrix for fit parameters? Something like “GetCovarianceMatrix(Element)” for the covariance matrix or do I have to calculate it “by hand” from the covariance matrix?


see: TFitter::GetCovarianceMatrix or TFitter::GetCovarianceMatrixElement or TMinuit::mnemat … anceMatrix … rixElement … uit:mnemat

To get a pointer to the current Fitter, do


TVirtualFitter *fitter = TVirtualFitter::GetFitter();
TMatrixDSym cov;

You have now wrapped the pointer to the covariance matrix in a
TMatrixDSym object without copying the actual data .

Accessing the parameter variance vector can now be done through:

TVectorD var = TMatrixDDiag(cov);


Hi, is it somehow possible to perform a “correlated” fit? I have to data sets for which I have the covariance matrices and I would need to perform a fit for both measurements considereing these matrices?
Best regards

I need to get the covariance matrix in order to calculate the reduced Chi-square for adding bin-by-bin correlations for my histograms. Could you help me with constructing the covariance matrix and inverted covariance matrix which has shown in the following screenshot:

This post is unrelated to the subject of the thread. You want the covariance matrix from an histogram or from a sample of data points (not clear to me).
You can look at TH2::GetCovariance or TRobustEstimator
But please open a new thread.