Back to Aurora Vision Library website

You are here: Start » Function Reference » Basic » Statistics » PearsonCorrelation_Weighted

PearsonCorrelation_Weighted


Header: STD.h
Namespace: avl
Module: FoundationLite

Computes Pearson product-moment correlation coefficient with weights.

Syntax

void avl::PearsonCorrelation_Weighted
(
	const atl::Array<float>& inValues1,
	const atl::Array<float>& inValues2,
	const atl::Array<float>& inWeights,
	float inMinStdDev,
	float& outCorrelation
)

Parameters

Name Type Range 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
Input value inWeights const Array<float>& Weights corresponding to the elements of 'inValues1' and 'inValues2'
Input value inMinStdDev float 0.0 - 0.001f Minimum value of standard deviation for correlation to be non-zero
Output value outCorrelation float& Computed correlation coefficient between two variables

Errors

List of possible exceptions:

Error type Description
DomainError Cannot compute the value of PearsonCorrelation_Weighted. The standard deviation of some set of input values is equal to zero.
DomainError Empty array on input in PearsonCorrelation_Weighted.
DomainError Inconsistent size of arrays in PearsonCorrelation_Weighted.