naginterfaces.library.correg.linregm_​service_​select

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

linregm_service_select takes selected elements from two vectors (typically vectors of means and standard deviations) to form two smaller vectors, and selected rows and columns from 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) to form two smaller matrices, allowing reordering of elements in the process.

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

https://www.nag.com/numeric/nl/nagdoc_29.3/flhtml/g02/g02cef.html

Parameters
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 .

korderint, array-like, shape

must be set to the number of the original variable which is to be the th variable in the output vectors and matrices, for .

Returns
xbar2float, ndarray, shape

The mean of variable , , where , for . (The array must differ from and .)

std2float, ndarray, shape

The standard deviation of variable , , where , for . (The array must differ from both and .)

ssp2float, ndarray, shape

contains the value of , where and , for , for . (The array must differ from both and .)

That is to say: on exit, contains the sum of cross-products of deviations from means (or about zero, ).

r2float, ndarray, shape

contains the value of , where and , for , for . (The array must differ from both and .)

That is to say: on exit, contains the Pearson product-moment coefficient (or the correlation-like coefficient, ).

Raises
NagValueError
(errno )

On entry, .

Constraint: .

(errno )

On entry, .

Constraint: .

(errno )

On entry, and .

Constratint: .

(errno )

On entry, and .

Constraint: , for .

Notes

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

Input to the function consists of:

  1. A vector of means:

    where is the number of input variables.

  2. A vector of standard deviations:

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

  4. A matrix of correlation coefficients:

  5. The number of variables, , in the required subset, and their row/column numbers in the input data, ,

New vectors and matrices are output containing the following information:

  1. A vector of means:

  2. A vector of standard deviations:

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

  4. A 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.