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
- attr_in1, attr_in2: the collection col_in stores the vector of characteristics
used for the calculus. If there are n vectors of p characteristics,
the collection should contain p arrays attr_in.1, attr_in.2,
..., attr_in.p of n floats each.
- attr_out: the collection col_out contains :
- attr_out.mat : the array des p*p
s de la matrice de covariance ;
- attr_out.inv : the array des p*p values
of the inverse matrix of covariance ;
- attr_out.det : the determinant of the covariance matrice
- attr_out.det : the array of p
values of the mean vector of characteritics.
Inputs
- col_in: a collection with the array name_in1.
- col_in: a collection with the array name_in2 of the same size as name_in1.
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