PANDORE Version 6 GREYC-IMAGE

pcorrelationcoefficient



Calculates the correlation cofficient between two arrays of values.



Synopsis

pcorrelationcoefficient attr_in1 attr_in2 attr_out [col_in1|-] [col_in2|-] [col_out|-]

Description

pcorrelationcoefficient calculates the correlation value between two variables represented each by an array of values of the same size and stored in a collection.

The sample correlation coefficient between the two vecteurs X and Y is given by:

r_{xy} = \frac{\sum\limits_{i=1}^n (x_i-\bar{x})(y_i-\bar{y})}{(n-1) s_x s_y}
       = \frac{\sum\limits_{i=1}^n (x_i-\bar{x})(y_i-\bar{y})} {\sqrt{\sum\limits_{i=1}^n (x_i-\bar{x})^2 \sum\limits_{i=1}^n (y_i-\bar{y})^2}}, 
where x and y are the sample means of X and Y, and sx and sy are the sample standard deviations of X and Y.

Parameters

Inputs

Outputs

Result

Returns the value of correlation.

Examples

pcorrelationcoefficient Correctness Correctness r ccorrectness1.pan ccorrectness2.pan toto.pan

See also

Array

C++ prototype

Errc PCorrelationCoefficient( const Collection &col_in1, const Collection &col_in2, Collection &col_out, const string &attr_in1, const string &attr_in2, const string &attr_out );

Author: Régis Clouard