Back to Aurora Vision Library Lite website

You are here: Start » Basic » Statistics » PearsonCorrelation

PearsonCorrelation


Header: STD.h
Namespace: avl

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
Input value inValues1 const Array<float>& Array of values of the first variable
Input value inValues2 const Array<float>& Array of values of the second variable
Output value 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.