I want to perform a chi2 fit to a histogram (histogram is a TH1 and the function a TF1). In the usual chi2 fit, it is assumed the histogram bin population is uncorrelated so, the covariance V matrix is diagonal.
However, I know that my in histogram the bins are correlated, so my V is not diagonal. Is there a way to instruct the TH1::Fit to use a non diagonal covariance matrix?
Thanks
Salva
PS: the chi2 defined as: chi2 = (observed - expected)^T V^{-1} (observed - expected)
We don’t have in ROOT support for fitting an histogram or Graph with correlated data points. You will have to create yourself your Chi2 functions and minimise yourself.
The ROOT::Fit::Fitter class can help you doing this, as is shown in the tutorial line3Dfit.C, where in this case the distance line-point is minimised.
See https://root.cern.ch/doc/master/line3Dfit_8C.html