This function computes the Partial Least Squares fit.
pls.model( X, y, m = ncol(X), Xtest = NULL, ytest = NULL, compute.DoF = FALSE, compute.jacobian = FALSE, use.kernel = FALSE, method.cor = "pearson" )
X | matrix of predictor observations. |
---|---|
y | vector of response observations. The length of |
m | maximal number of Partial Least Squares components. Default is
|
Xtest | optional matrix of test observations. Default is
|
ytest | optional vector of test observations. Default is
|
compute.DoF | Logical variable. If |
compute.jacobian | Should the first derivative of the regression
coefficients be computed as well? Default is |
use.kernel | Should the kernel representation be used to compute the
solution. Default is |
method.cor | How should the correlation to the response be computed? Default is ''pearson''. |
matrix of regression coefficients
vector of intercepts
vector of Degrees of Freedom
vector of residual sum of error
vector of estimated model error
matrix of fitted values
vector of squared length of fitted values
if
compute.jacobian
is TRUE
, the function returns the array of
covariance matrices for the PLS regression coefficients.
This function computes the Partial Least Squares fit and its Degrees of
Freedom. Further, it returns the regression coefficients and various
quantities that are needed for model selection in combination with
information.criteria
.
Kraemer, N., Sugiyama M. (2011). "The Degrees of Freedom of Partial Least Squares Regression". Journal of the American Statistical Association 106 (494) https://www.tandfonline.com/doi/abs/10.1198/jasa.2011.tm10107
Kraemer, N., Sugiyama, M., Braun, M.L. (2009) "Lanczos Approximations for the Speedup of Partial Least Squares Regression", Proceedings of the 12th International Conference on Artificial Intelligence and Stastistics, 272 - 279
Nicole Kraemer, Mikio L. Braun
n<-50 # number of observations p<-15 # 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 PLS + degrees of freedom + prediction on Xtest first.object<-pls.model(X,y,compute.DoF=TRUE,Xtest=Xtest,ytest=NULL) # compute PLS + test error second.object=pls.model(X,y,m=10,Xtest=Xtest,ytest=ytest)