Back to Adaptive Vision Library website

You are here: Start » Function Reference » Statistics » PearsonCorrelation


Header: STD.h
Namespace: avl
Module: FoundationLite

Computes Pearson product-moment correlation coefficient. The array must be not empty.


void avl::PearsonCorrelation
	const atl::Array<float>& inValues1,
	const atl::Array<float>& inValues2,
	float& outCorrelation


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


  • Make sure that the standard deviation of both input arrays is non-zero.


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.