Back to Adaptive Vision Library website
You are here: Start » Function Reference » Statistics » PearsonCorrelation
Computes Pearson product-moment correlation coefficient. The array must be not empty.
Syntax
void avl::PearsonCorrelation ( const atl::Array<float>& inValues1, const atl::Array<float>& inValues2, float& outCorrelation )
Parameters
Name | Type | Default | Description | |
---|---|---|---|---|
inValues1 | const Array<float>& | Array of values of the first variable | ||
inValues2 | const Array<float>& | Array of values of the second variable | ||
outCorrelation | float& | 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. |