Learn R Programming

plsdof (version 0.2-1)

pls.cv: Model selection for Partial Least Squares based on cross-validation

Description

This function computes the optimal model parameter using cross-validation.

Usage

pls.cv(X, y, k, m,use.kernel=FALSE,compute.covariance=FALSE)

Arguments

X
matrix of predictor observations.
y
vector of response observations. The length of y is the same as the number of rows of X.
k
number of cross-validation splits. Default is 10.
m
maximal number of Partial Least Squares components. Default is m=ncol(X).
use.kernel
Use kernel representation? Default is use.kernel=FALSE.
compute.covariance
If TRUE, the function computes the covariance for the cv-optimal regression coefficients.

Value

  • The function returns an object of class "plsdof".
  • cv.errorvector of cross-validated errors
  • m.optoptimal number of components
  • interceptintercept
  • coefficientsvector of regression coefficients
  • covarianceIf TRUE and use.kernel=FALSE, the covariance of the cv-optimal regression coefficients is returned.

Details

to do

References

Kraemer, N., Sugiyama M. (2010). "The Degrees of Freedom of Partial Least Squares Regression". preprint, http://arxiv.org/abs/1002.4112 Kraemer, N., Braun, M.L. (2007) "Kernelizing PLS, Degrees of Freedom, and Efficient Model Selection", Proceedings of the 24th International Conference on Machine Learning, Omni Press, 441 - 448

See Also

pls.model, pls.ic

Examples

Run this code
n<-50 # number of observations
p<-5 # number of variables
X<-matrix(rnorm(n*p),ncol=p)
y<-rnorm(n)

# compute linear PLS
pls.object<-pls.cv(X,y,m=ncol(X))

Run the code above in your browser using DataLab