Back to Adaptive Vision Library website
You are here: Start » Function Reference » Statistics » PearsonCorrelation
PearsonCorrelation
Computes Pearson product-moment correlation coefficient. The array must be not empty.
Syntax
void avl::PearsonCorrelation ( const atl::Array<atl::real>& inValues1, const atl::Array<atl::real>& inValues2, atl::real& outCorrelation )
Parameters
| Name | Type | Default | Description | |
|---|---|---|---|---|
![]() |
inValues1 | const Array<real>& | Array of values of the first variable | |
![]() |
inValues2 | const Array<real>& | Array of values of the second variable | |
![]() |
outCorrelation | real& | Computed correlation coefficient between two variables |
Hints
- Make sure that the standard deviation of both input arrays is non-zero.
Errors
| Error type | Description |
|---|---|
| DomainError | Inconsistent size of arrays in PearsonCorrelation. |
| DomainError | Empty array on input in PearsonCorrelation. |
| DomainError | Cannot compute the value of PearsonCorrelation. The standard deviation of some set of input values is equal to zero. |


