naginterfaces.library.correg.pls_pred¶
- naginterfaces.library.correg.pls_pred(orig, xbar, ybar, iscale, xstd, ystd, b, isz, z)[source]¶
pls_pred
calculates predictions given the output from an orthogonal scores PLS regression (pls_svd()
orpls_wold()
) andpls_fit()
.For full information please refer to the NAG Library document for g02ld
https://support.nag.com/numeric/nl/nagdoc_30.2/flhtml/g02/g02ldf.html
- Parameters
- origint
Indicates how parameter estimates are supplied.
Parameter estimates are for the original data.
Parameter estimates are for the centred, and possibly scaled, data.
- xbarfloat, array-like, shape
If , must contain mean values of predictor variables in the model; otherwise is not referenced.
- ybarfloat, array-like, shape
If , must contain the mean value of each response variable in the model; otherwise is not referenced.
- iscaleint
If , must take the value supplied to either
pls_svd()
orpls_wold()
; otherwise is not referenced.- xstdfloat, array-like, shape
If and , must contain the scalings of predictor variables in the model as returned from either
pls_svd()
orpls_wold()
; otherwise is not referenced.- ystdfloat, array-like, shape
If and , must contain the scalings of response variables as returned from either
pls_svd()
orpls_wold()
; otherwise is not referenced.- bfloat, array-like, shape
Note: the required extent for this argument in dimension 1 is determined as follows: if : ; if : ; otherwise: .
If , must contain the parameter estimate for the centred, and possibly scaled, data as returned by
pls_fit()
; otherwise must contain the parameter estimates for the original data as returned bypls_fit()
.- iszint, array-like, shape
Indicates which predictor variables are to be included in the model. Predictor variables included from must be in the same order as those included in the fitted model.
If , the th predictor variable is included in the model, for , otherwise .
- zfloat, array-like, shape
contains the th observation on the th available predictor variable, for , for .
- Returns
- yhatfloat, ndarray, shape
contains the th predicted value of the th -variable in the model.
- Raises
- NagValueError
- (errno )
On entry, .
Constraint: .
- (errno )
On entry, .
Constraint: .
- (errno )
On entry, .
Constraint: or .
- (errno )
On entry, .
Constraint: if , , or .
- (errno )
On entry, .
Constraint: .
- (errno )
On entry, .
Constraint: or .
- (errno )
On entry, and .
Constraint: if , .
- (errno )
On entry, and .
Constraint: if , .
- (errno )
On entry, and .
Constraint: .
- (errno )
On entry, the number of elements of equal to is not .
- Notes
pls_pred
calculates the predictions of a PLS model given a set of test data and a set of parameter estimates as returned bypls_fit()
.If
pls_fit()
returns parameter estimates for the original data scale, no further information is required.If
pls_fit()
returns parameter estimates for the centred, and possibly scaled, data, further information is required. The means of variables in the fitted model must be supplied. In the case of a PLS model fitted by using scaled data, the means and standard deviations of variables in the fitted model must also be supplied. These means and standard deviations are those returned by eitherpls_svd()
andpls_wold()
.