penalized.pls.cv {ppls}R Documentation

Cross-validation for Penalized PLS

Description

Computes the cross-validated error of penalized PLS for different values of lambda and components, and returns the parameter values and coefficients for the optimal model.

Usage

penalized.pls.cv(X, y, P, lambda, ncomp, k, kernel,scale)

Arguments

X matrix of input data
y vector of responses
P Penalty matrix. For the default value P=NULL, no penalty term is used, i.e. ordinary PLS is computed.
lambda vector of candidate parameters lambda for the amount of penalization. Default value is 1
ncomp Number of penalized PLS components to be computed. Default value is min(nrow(X)-1,ncol(X))
k the number of splits in k-fold cross-validation. Default value is k=5.
kernel Logical value. If kernel=TRUE, the kernelized version of penalized PLS is computed. Default value is kernel=FALSE
scale logical value. If scale=TRUE, the X variables are standardized to have unit variance. Default value is FALSE

Value

error.cv matrix of cross-validated errors. The rows correspond to the values of lambda, the columns correspond to the number of components.
lambda.opt Optimal value of lambda
ncomp.opt Optimal number of penalized PLS components
min.ppls Cross-validated error for the optimal penalized PLS solution
intercept Intercept for the optimal model, computed on the whole data set
coefficients Regression coefficients for the optimal model, computed on the whole data set

Author(s)

Nicole Kr"amer

References

N. Kr"amer, A.-L. Boulsteix, and G. Tutz (2008). Penalized Partial Least Squares with Applications to B-Spline Transformations and Functional Data. Chemometrics and Intelligent Laboratory Systems 94, 60 - 69.

See Also

ppls.splines.cv,penalized.pls,new.penalized.pls

Examples

# the penalty term in this example does not make much
# sense
X<-matrix(rnorm(20*100),ncol=20)
y<-rnorm(rnorm(100))
P<-Penalty.matrix(m=20)
pen.pls<-penalized.pls.cv(X,y,lambda=c(0,1,10),P=P,ncomp=10,kernel=FALSE)

[Package ppls version 1.03 Index]