naginterfaces.library.correg.linregm_​service_​reorder

naginterfaces.library.correg.linregm_service_reorder(korder, xbar, std, ssp, r)[source]

linregm_service_reorder reorders the elements in two vectors (typically vectors of means and standard deviations), and the rows and columns in two matrices (typically either matrices of sums of squares and cross-products of deviations from means and Pearson product-moment correlation coefficients, or matrices of sums of squares and cross-products about zero and correlation-like coefficients).

For full information please refer to the NAG Library document for g02cf

https://support.nag.com/numeric/nl/nagdoc_30/flhtml/g02/g02cff.html

Parameters
korderint, array-like, shape

must be set to the number of the original variable which is to be the th variable in the re-arranged data, for .

xbarfloat, array-like, shape

must be set to the mean of variable , for .

stdfloat, array-like, shape

must be set to the standard deviation of variable , for .

sspfloat, array-like, shape

must be set to the sum of cross-products of deviations from means (or about zero ) for variables and , for , for .

rfloat, array-like, shape

must be set to the Pearson product-moment correlation coefficient (or the correlation-like coefficient ) for variables and , for , for .

Returns
xbarfloat, ndarray, shape

contains the mean of variable where , for .

stdfloat, ndarray, shape

contains the standard deviation of variable where , for .

sspfloat, ndarray, shape

contains the sum of cross-products of deviations from means (or about zero ) for variables and , where , and , .

rfloat, ndarray, shape

contains the Pearson product-moment correlation coefficient (or the correlation-like coefficient ) for variables and , where and , for , for .

Raises
NagValueError
(errno )

On entry, .

Constraint: .

(errno )

On entry, and .

Constraint: , for .

(errno )

On entry, there is not a one-to-one correspondence between the old variables and the new variables; at least one of the original variables is not included in the new set, and consequently at least one other variable has been included more than once.

Notes

No equivalent traditional C interface for this routine exists in the NAG Library.

Input to the function consists of:

  1. A list of the order in which the variables are to be arranged on exit:

  2. A vector of means:

  3. A vector of standard deviations:

  4. A matrix of sums of squares and cross-products of deviations from means:

  5. A matrix of correlation coefficients:

On exit from the function, these same vectors and matrices are reordered, in the manner specified, and contain the following information:

  1. The vector of means:

  2. The vector of standard deviations:

  3. The matrix of sums of squares and cross-products of deviations from means:

  4. The matrix of correlation coefficients:

Note: for sums of squares of cross-products of deviations about zero and correlation-like coefficients and should be replaced by and in the description of the input and output above.