naginterfaces.library.correg.pls_​svd

naginterfaces.library.correg.pls_svd(x, isx, y, iscale, xstd, ystd, maxfac, io_manager=None)[source]

pls_svd fits an orthogonal scores partial least squares (PLS) regression by using singular value decomposition.

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

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

Parameters
xfloat, array-like, shape

must contain the th observation on the th predictor variable, for , for .

isxint, array-like, shape

Indicates which predictor variables are to be included in the model.

The th predictor variable (with variates in the th column of ) is included in the model.

Otherwise.

yfloat, array-like, shape

must contain the th observation for the th response variable, for , for .

iscaleint

Indicates how predictor variables are scaled.

Data are scaled by the standard deviation of variables.

Data are scaled by user-supplied scalings.

No scaling.

xstdfloat, array-like, shape

If , must contain the user-supplied scaling for the th predictor variable in the model, for . Otherwise need not be set.

ystdfloat, array-like, shape

If , must contain the user-supplied scaling for the th response variable in the model, for . Otherwise need not be set.

maxfacint

, the number of latent variables to calculate.

io_managerFileObjManager, optional

Manager for I/O in this routine.

Returns
xbarfloat, ndarray, shape

Mean values of predictor variables in the model.

ybarfloat, ndarray, shape

The mean value of each response variable.

xstdfloat, ndarray, shape

If , standard deviations of predictor variables in the model. Otherwise is not changed.

ystdfloat, ndarray, shape

If , the standard deviation of each response variable. Otherwise is not changed.

xresfloat, ndarray, shape

The predictor variables’ residual matrix .

yresfloat, ndarray, shape

The residuals for each response variable, .

wfloat, ndarray, shape

The th column of contains the -weights , for .

pfloat, ndarray, shape

The th column of contains the -loadings , for .

tfloat, ndarray, shape

The th column of contains the -scores , for .

cfloat, ndarray, shape

The th column of contains the -loadings , for .

ufloat, ndarray, shape

The th column of contains the -scores , for .

xcvfloat, ndarray, shape

contains the cumulative percentage of variance in the predictor variables explained by the first factors, for .

ycvfloat, ndarray, shape

is the cumulative percentage of variance of the th response variable explained by the first factors, for , for .

Raises
NagValueError
(errno )

On entry, .

Constraint: .

(errno )

On entry, .

Constraint: .

(errno )

On entry, is invalid.

Constraint: or , for all .

(errno )

On entry, .

Constraint: .

(errno )

On entry, .

Constraint: or .

(errno )

On entry, and .

Constraint: .

(errno )

On entry, and .

Constraint: .

(errno )

On entry, and .

Constraint: the sum of elements in must equal .

Notes

Let be the mean-centred data matrix of observations on predictor variables. Let be the mean-centred data matrix of observations on response variables.

The first of the factors PLS methods extract from the data predicts both and by regressing on a column vector of scores:

where the column vectors of -loadings and -loadings are calculated in the least squares sense:

The -score vector is the linear combination of predictor data that has maximum covariance with the -scores , where the -weights vector is the normalised first left singular vector of .

The method extracts subsequent PLS factors by repeating the above process with the residual matrices:

and with orthogonal scores:

Optionally, in addition to being mean-centred, the data matrices and may be scaled by standard deviations of the variables. If data are supplied mean-centred, the calculations are not affected within numerical accuracy.