# Uncertainty of TH2::GetCorrelationFactor()

Dear all,

I am using TH2::GetCorrelationFactor() to get correlation coefficients of my MC and data. I was wondering, if there is a way to determine their statistical precision to see their significance, e.g. rho = 0.3 ± 0.2. I cannot find a suitable function in Root and browsing the web only brought an approximate expression for normal distributions:

``````double GetCorrelationFactorError(TH2F* h){
double n=h->GetEntries();
double rho=h->GetCorrelationFactor();
double rhoe= (1-pow(rho,2))/sqrt(n-1);
return rhoe;
}``````

Does anyone know a way how to get this uncertainty for any distribution?

Cheers,
Andreas

Hi,

I think you will find expression for the uncertainty on the correlation coefficient only if the parent distribution is a bi-variate gaussian.
In the general case, I would just generate toys, resampling the histogram from the original one to obtained a distribution of rho and from there deduce the uncertainty.

Lorenzo

Hi Lorenzo,

but in this case I can only take a subsample for the correlation estimate, while I would have to use the full statistics for the toys. Otherwhise they will be correlated and the rho distribution might come out with a smaller width than for independent samples. Also I would end up drawing the same event several times, which would also bias the width. But I guess if that’s the only way then I can at least determine a lower bound for the uncertainty.

Cheers,
Andreas

Hi,

I think you should take the full statistics for both the toys and for estimating the correlation. In addition, if you have it you should use the full original data for estimating the density for bootstrapping.
You could also try to use a kernel density estimator from the original data, from which you can sample your toys to estimate the variance of the correlation

Cheers

Lorenzo