Back to FabImage Library website
You are here: Start » Function Reference » Statistics » PearsonCorrelation
Header: | STD.h |
---|---|
Namespace: | fil |
Computes Pearson product-moment correlation coefficient. The array must be not empty.
Syntax
void fil::PearsonCorrelation ( const ftl::Array<float>& inValues1, const ftl::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
List of possible exceptions:
Error type | Description |
---|---|
DomainError | Cannot compute the value of PearsonCorrelation. The standard deviation of some set of input values is equal to zero. |
DomainError | Empty array on input in PearsonCorrelation. |
DomainError | Inconsistent size of arrays in PearsonCorrelation. |