TMVA::Tools::GetCorrelationRatio() returns a value larger than 1

I’m Trying to get the correlation ratio for my TH2F, and I encountered this problem. This is my code:

TMVA::Tools & tmvaInstace = TMVA::Tools::Instance();

TFile file(<file_name>);
TH2F *hist;
file.GetObject(<histogram_name>, hist);
const TH2F &constHistRef = *hist;

cout << "Correlaton ratio: " << tmvaInstace.GetCorrelationRatio(constHistRef) << endl;

The value I get from the method is 1.02180220974304570e+00, which is statistically impossible… What am I doing wrong? I tried removing the ‘const’ decleration from constHistRef, but got no change.

Thank you!


I am not sure what exactly is what you want to compute. Do you have a mathematical formula ?

If you want the sample correlation coefficient between the x and y variable
(see definition at … dependence),
you should use TH2::GetCorrelationFactor()