# Fitting a covariance matrix

Dear Experts,

I am looking for guidance on fitting a covariance matrix.
My problem can be simplified as the following.
I need to measure 4 features in certain collisions, (x1, x2, x3, x4).
What I can actually measure experimentally are the covariant matrix for 1M events.
x1x1, x1x2, x1x3, x1x4
x2x1, x2x2, x2x3, x2x4
x3x1, x3x2, x3x3, x3x4
x4x1, x4x2, x4x3, x4x4

Given such 4x4 matrix and the error bars associated to each elements, how could I fit to get the best estimate of (x1, x2, x3, x4)?
Since this is a symmetric matrix, I have 10 variables to constraint 4 free parameters.
What if I have to disregard the diagonal terms, i.e., using 6 variables to constraint 4 parameters?
I reality, I may have 30x30 matrix constraint 30 parameters, and have to disregard the diagonal terms and next diagonal terms, such as (x2x1, x3x2, x4*x3 … terms).

Is there an easy way to construct the chi square fit for the fit? or an example I should follow?

Thanks,

Hi,

Have you tried creating just a global chi-square using as residuals the difference between the observed covariance matrix element and the expected one divided by the measured uncertainties ?
I assume the covariance elects estimates are uncorrelated otherwise you would have to take those correlation into account

Best Regards

Lorenzo

Hi Moneta,

I am thinking of that.
Can you point me to an example code of minimizing the chi2, as well as calculating the proper error bars?

Thanks

[quote=“moneta”]Hi,

Have you tried creating just a global chi-square using as residuals the difference between the observed covariance matrix element and the expected one divided by the measured uncertainties ?
I assume the covariance elects estimates are uncorrelated otherwise you would have to take those correlation into account

Best Regards

Lorenzo[/quote]

Hi,

Here is an example of minimising a chi2 function, using the ROOT Fitter class

Lorenzo

fitCircle.C (2.31 KB)