- naginterfaces.library.correg.ssqmat_to_corrmat(m, r)¶
ssqmat_to_corrmatcalculates a matrix of Pearson product-moment correlation coefficients from sums of squares and cross-products of deviations about the mean.
For full information please refer to the NAG Library document for g02bw
, the number of variables.
- rfloat, array-like, shape
Contains the upper triangular part of the sums of squares and cross-products matrix of deviations from the mean. These are stored packed by column, i.e., the cross-product between variable and , , is stored in .
- rfloat, ndarray, shape
The Pearson product-moment correlation coefficients.
These are stored packed by column corresponding to the input cross-products.
- (errno )
On entry, .
- (errno )
A variable has a zero variance. All correlations involving the variable with zero variance will be returned as zero.
ssqmat_to_corrmatcalculates a matrix of Pearson product-moment correlation coefficients from sums of squares and cross-products about the mean for observations on variables which can be computed by a single call to
ssqmat()or a series of calls to
ssqmat_update(). The sums of squares and cross-products are stored in an array packed by column and are overwritten by the correlation coefficients.
Let be the cross-product of deviations from the mean, for , for , then the product-moment correlation coefficient, is given by