kernel.pls {plsdof} | R Documentation |
This function computes the Kernel Partial Least Squares fit.
kernel.pls(X, y, m = ncol(X), Xtest, ytest, compute.DoF, type, sigma, step.size)
X |
matrix of predictor observations. |
y |
vector of response observations. The length of y is the same as the number of rows of X .
|
m |
maximal number of Partial Least Squares components. Default is m =ncol(X).
|
Xtest |
optional matrix of test observations. Default is Xtest=NULL .
|
ytest |
optional vector of test observations. Default is ytest=NULL .
|
compute.DoF |
Logical variable. If compute.DoF=TRUE , the Degrees of Freedom of Partial Least Squares are computed. Default is compute.DoF=FALSE .
|
type |
type of kernel. type="vanilla" is a linear kernel. type="gaussian" is a gaussian kernel. Default is type="vanilla" .
|
sigma |
vector of kernel parameters. If type="gaussian" , these are the kernel widths. If the vanilla kernel is used,
sigma is not used. Default value is sigma =1.
|
step.size |
After how many steps should the latent components be re-orthogonalized? See kernel.pls.fit for more details. Default is step.size=1 .
|
For the linear kernel (type="vanilla"
), we standardize X
to zero mean and unit variance. For the Gaussian kernel (type="gaussian"
), we normalize X
such that the range of each column is [-1,1].
The default value for sigma
is in general NOT a sensible parameter, and sigma
should always be selected via a model selection criterion. The default value for m
is a sensible upper bound only for the vanilla kernel.
A |
array of kernel coefficients |
prediction |
prediction on Xtest , if Xtest is provided |
mse |
test error, if Xtest and ytest is provided |
coefficients |
matrix of regression coefficients, if type="vanilla" |
intercept |
vector of regression intercepts, if type="vanilla" |
DoF |
Degrees of Freedom, if compute.DoF=TRUE |
RSS |
residual sum of squares, if compute.DoF=TRUE |
Yhat |
array of fitted values |
sigmahat |
vector of estimated model error, if compute.DoF=TRUE |
yhat |
sum of squared fitted values |
Nicole Kraemer, Mikio L. Braun
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
n<-50 # number of observations p<-5 # number of variables X<-matrix(rnorm(n*p),ncol=p) y<-rnorm(n) ntest<-200 # Xtest<-matrix(rnorm(ntest*p),ncol=p) # test data ytest<-rnorm(ntest) # test data # compute linear PLS + degrees of freedom + prediction on Xtest linear.object<-kernel.pls(X,y,m=ncol(X),compute.DoF=TRUE,Xtest=Xtest,ytest=NULL) # compute nonlinear PLS + test error sigma=exp(seq(0,4,length=10)) nonlinear.object=kernel.pls(X,y,m=10,type="gaussian",sigma=sigma,Xtest=Xtest,ytest=ytest)