Overload List
| # | Signature | Description |
|---|---|---|
| 1 | void CorrCoef(TDenseMtxVec *X, TDenseMtxVec *Y, TMtx *aResult); | Pearson correlation coefficients. |
| 2 | void CorrCoef(TDenseMtxVec *X, TDenseMtxVec *Y, TMtx *aResult, double &tValue); | Pearson correlation coefficients. |
| 3 | void CorrCoef(TMtx *X, TMtx *aResult); | Pearson correlation coefficients between matrix rows and cols. |
Overload 1: void CorrCoef(TDenseMtxVec *X, TDenseMtxVec *Y, TMtx *aResult);
Pearson correlation coefficients.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TDenseMtxVec * | Defines first sample (variable) values (observables). |
| 2 | Y | TDenseMtxVec * | Defines second sample (variable) values (observables). |
| 3 | aResult | TMtx * | Returns Pearson correlation coefficients bewteen samples X and Y. Size of Result is adjusted automatically. |
Correlation coefficient
The correlation coefficient rho between two random variables is defined by the following equation:
where x,y are two variables, Cov covariance betwen x and y, sigma(s) their expected standard deviations and E-s their expected values. If the variables are independent then the correlation is 0, but the converse is not true because the correlation coefficient detects only linear dependencies between two variables.
Sample correlation coefficients.
If we have a series of n measurements of X and Y, then the Pearson product-moment correlation coefficient can be used to estimate the correlation of X and Y. The Pearson coefficient is also known as the "sample correlation coefficient". The Pearson correlation coefficient is then the best estimate of the correlation of X and Y .
Overload 2: void CorrCoef(TDenseMtxVec *X, TDenseMtxVec *Y, TMtx *aResult, double &tValue);
Pearson correlation coefficients.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TDenseMtxVec * | |
| 2 | Y | TDenseMtxVec * | |
| 3 | aResult | TMtx * | |
| 4 | tValue | double & |
Additionally returns also the Students t-distribution value as an indicator of statistical significance.
Overload 3: void CorrCoef(TMtx *X, TMtx *aResult);
Pearson correlation coefficients between matrix rows and cols.
This version calculates Pearson correlation coefficients rx,y between X matrix rows and cols. X colums are treated as samples (variables) and rows as values (observables).