<< lowdisc_bitxor Support Functions lowdisc_dec2bin >>

Low Discrepancy >> Low Discrepancy > Support Functions > lowdisc_corrcoef

lowdisc_corrcoef

Correlation coefficients

Calling Sequence

r = lowdisc_corrcoef ( x )

Parameters

x :

a m-by-n matrix of doubles, the data. m is the number of observations. n is the number of variables.

r :

a n-by-n matrix of doubles, the correlation coefficient.

Description

Returns the matrix r of correlation coefficients calculated from an input matrix x. The matrix r is related to the covariance matrix c=cov(x) by

r(i,j) = c(i,j) / sqrt(c(i,i) * c(j,j)).

The cov function comes from Stixbox.

TODO : return p-values

Examples

// Uncorrelated data
x = grand(30,4,"nor",0,1)
// Introduce correlation.
x(:,4) = sum(x,2);
// Compute sample correlation
r = lowdisc_corrcoef ( x )

Authors

<< lowdisc_bitxor Support Functions lowdisc_dec2bin >>