nag_cov_to_corr (g02bwc) calculates a matrix of Pearson product-moment correlation coefficients from sums of squares and cross-products of deviations about the mean.
nag_cov_to_corr (g02bwc) calculates 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
nag_sum_sqs (g02buc) or a series of calls to
nag_sum_sqs_update (g02btc). 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
and
, then the product-moment correlation coefficient,
is given by
None.
The accuracy of nag_cov_to_corr (g02bwc) is entirely dependent upon the accuracy of the elements of array
r.
nag_cov_to_corr (g02bwc) is not threaded in any implementation.
nag_cov_to_corr (g02bwc) may also be used to calculate the correlations between parameter estimates from the variance-covariance matrix of the parameter estimates as is given by several functions in this chapter.
A program to calculate the correlation matrix from raw data. The sum of squares and cross-products about the mean are calculated from the raw data by a call to
nag_sum_sqs (g02buc). The correlation matrix is then calculated from these values.