penalized.pls.cv {ppls}R Documentation

Cross-validation for penalized PLS

Description

This function 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 A n x p matrix of input data, with observations corresponding to the rows and variables to the columns.
y A numeric n-vector of responses.
P The p x p penalty matrix. For the default value P=NULL, no penalty term is used, i.e. ordinary PLS is computed.
lambda A numeric vector giving the (positive) candidate values for the parameter lambda determining the amount of penalization. Default value is 1.
ncomp The maximum 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 If kernel=TRUE, the kernelized version of penalized PLS is computed. Default value is kernel=FALSE.
scale If scale=TRUE, the X variables are standardized to have unit variance. Default value is scale=FALSE.

Details

Value

lambda.opt The optimal value of the parameter lambda.
ncomp.opt The optimal number of penalized PLS components.
min.ppls The cross-validated error for the optimal penalized PLS solution.
intercept The intercept for the optimal model, computed on the whole data set.
coefficients The regression coefficients for the optimal model, computed on the whole data set.

Author(s)

Nicole Kraemer

References

N. Kraemer, A.-L. Boulesteix, G. Tutz (2007) "Penalized Partial Least Squares with Applications to B-Splines Transformations and Functional Data", preprint

available at http://ml.cs.tu-berlin.de/~nkraemer/publications.html

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.0 Index]