naginterfaces.library.correg.coeffs_​pearson

naginterfaces.library.correg.coeffs_pearson(x)[source]

coeffs_pearson computes means and standard deviations of variables, sums of squares and cross-products of deviations from means, and Pearson product-moment correlation coefficients for a set of data.

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

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

Parameters
xfloat, array-like, shape

must be set to , the th observation on the th variable, for , for .

Returns
xbarfloat, ndarray, shape

The mean value, , of the th variable, for .

stdfloat, ndarray, shape

The standard deviation, , of the th variable, for .

sspfloat, ndarray, shape

is the cross-product of deviations , for , for .

rfloat, ndarray, shape

is the product-moment correlation coefficient between the th and th variables, for , for .

Raises
NagValueError
(errno )

On entry, .

Constraint: .

(errno )

On entry, .

Constraint: .

Notes

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

The input data consist of observations for each of variables, given as an array

where is the th observation on the th variable.

The quantities calculated are:

  1. Means:

  2. Standard deviations:

  3. Sums of squares and cross-products of deviations from means:

  4. Pearson product-moment correlation coefficients:

    If or is zero, is set to zero.