PLS_lm_wvc: Light version of PLS\_lm for cross validation purposes

Description Usage Arguments Details Value Note Author(s) References See Also Examples

Description

Light version of PLS_lm for cross validation purposes either on complete or incomplete datasets.

Usage

1
2
3
PLS_lm_wvc(dataY, dataX, nt = 2, dataPredictY = dataX, modele = "pls", 
scaleX = TRUE, scaleY = NULL, keepcoeffs = FALSE, 
keepstd.coeffs=FALSE, tol_Xi = 10^(-12), weights, verbose=TRUE)

Arguments

dataY

response (training) dataset

dataX

predictor(s) (training) dataset

nt

number of components to be extracted

dataPredictY

predictor(s) (testing) dataset

modele

name of the PLS model to be fitted, only ("pls" available for this fonction.

scaleX

scale the predictor(s) : must be set to TRUE for modele="pls" and should be for glms pls.

scaleY

scale the response : Yes/No. Ignored since non always possible for glm responses.

keepcoeffs

whether the coefficients of unstandardized eXplanatory variables should be returned or not.

keepstd.coeffs

whether the coefficients of standardized eXplanatory variables should be returned or not.

tol_Xi

minimal value for Norm2(Xi) and det(pp'*pp) if there is any missing value in the dataX. It defaults to 10^{-12}

weights

an optional vector of 'prior weights' to be used in the fitting process. Should be NULL or a numeric vector.

verbose

should info messages be displayed ?

Details

This function is called by PLS_lm_kfoldcv in order to perform cross-validation either on complete or incomplete datasets.

Non-NULL weights can be used to indicate that different observations have different dispersions (with the values in weights being inversely proportional to the dispersions); or equivalently, when the elements of weights are positive integers w_i, that each response y_i is the mean of w_i unit-weight observations.

Value

valsPredict

nrow(dataPredictY) * nt matrix of the predicted values

coeffs

If the coefficients of the eXplanatory variables were requested:
i.e. keepcoeffs=TRUE.
ncol(dataX) * 1 matrix of the coefficients of the the eXplanatory variables

Note

Use PLS_lm_kfoldcv for a wrapper in view of cross-validation.

Author(s)

Frederic Bertrand
[email protected]
http://www-irma.u-strasbg.fr/~fbertran/

References

Nicolas Meyer, Myriam Maumy-Bertrand et Frederic Bertrand (2010). Comparing the linear and the logistic PLS regression with qualitative predictors: application to allelotyping data. Journal de la Societe Francaise de Statistique, 151(2), pages 1-18. http://publications-sfds.math.cnrs.fr/index.php/J-SFdS/article/view/47

See Also

PLS_lm for more detailed results, PLS_lm_kfoldcv for cross-validating models and PLS_glm_wvc for the same function dedicated to plsRglm models

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
data(Cornell)
XCornell<-Cornell[,1:7]
yCornell<-Cornell[,8]
PLS_lm_wvc(dataY=yCornell,dataX=XCornell,nt=3,dataPredictY=XCornell[1,])
PLS_lm_wvc(dataY=yCornell[-c(1,2)],dataX=XCornell[-c(1,2),],nt=3,dataPredictY=XCornell[c(1,2),],
verbose=FALSE)
PLS_lm_wvc(dataY=yCornell[-c(1,2)],dataX=XCornell[-c(1,2),],nt=3,dataPredictY=XCornell[c(1,2),],
keepcoeffs=TRUE, verbose=FALSE)
rm("XCornell","yCornell")

## With an incomplete dataset (X[1,2] is NA)
data(pine)
ypine <- pine[,11]
data(XpineNAX21)
PLS_lm_wvc(dataY=ypine[-1],dataX=XpineNAX21[-1,],nt=3, verbose=FALSE)
PLS_lm_wvc(dataY=ypine[-1],dataX=XpineNAX21[-1,],nt=3,dataPredictY=XpineNAX21[1,], verbose=FALSE)
PLS_lm_wvc(dataY=ypine[-2],dataX=XpineNAX21[-2,],nt=3,dataPredictY=XpineNAX21[2,], verbose=FALSE)
PLS_lm_wvc(dataY=ypine,dataX=XpineNAX21,nt=3, verbose=FALSE)
rm("ypine")

fbertran/plsRglm documentation built on May 16, 2019, 9:16 a.m.