# Correlation coefficient from GetCorrelationFactor()

**URL:** <https://root-forum.cern.ch/t/correlation-coefficient-from-getcorrelationfactor/41643>\
**Category:** Newbie\
**Created:** [September 29, 2020, 8:38am UTC](https://root-forum.cern.ch/t/correlation-coefficient-from-getcorrelationfactor/41643 "2020-09-29T08:38:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Newbie](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/n/dc4da7/32.png) [@Newbie](https://root-forum.cern.ch/u/Newbie)\
**Post date:** [September 29, 2020, 8:38am UTC](https://root-forum.cern.ch/t/correlation-coefficient-from-getcorrelationfactor/41643/1 "2020-09-29T08:38:56Z")

</div>

Dear,

I was wondering if GetCorrelationFactor() checks for non-linear correlations, or only linear correlations (Pearson correlation coefficient)? Also, is there way to estimate the correlation function using Root?

thank you!

---

<div class="post-metadata">

**Author:** ![moneta](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/moneta/32/19423_2.png) [@moneta](https://root-forum.cern.ch/u/moneta)\
**Post date:** [September 29, 2020, 9:23am UTC](https://root-forum.cern.ch/t/correlation-coefficient-from-getcorrelationfactor/41643/2 "2020-09-29T09:23:25Z")

</div>

Hi,

The function `GetCorrelationFactor` applied to an histogram (TH2 or TH3) estimates the Pearson correlation coefficient, using the histogram statistics

The Correlation function is something that applies for a sequence (e.g. time series) of random variables  
`x(t)` and `y(t)`. We don’t have such a function in ROOT, but you can probably easily implement using what we have in ROOT

Lorenzo
