Description Usage Arguments Details Value Author(s) References See Also Examples
computes the regression coefficients for Penalized Partial Least Squares.
1 | penalized.pls(X, y, P, ncomp, kernel, scale ,blocks,select)
|
X |
matrix of input data |
y |
vector of response data |
P |
penalty matrix. Default value is P=NULL, i.e. no penalization is used |
ncomp |
number of components, default value is the rank of the centered matrix |
kernel |
logical value. If kernel=TRUE, penalized PLS is computed based on the kernel algorithm. Default value is kernel=FALSE |
scale |
logical value. If scale=TRUE, the X variables are standardized to have unit variance. Default value is FALSE |
blocks |
vector of length |
select |
logical variable. If |
The regression coefficients can be computed in two different
but equivalent ways. The first one is the extension of the classical
NIPALS algorithm for PLS (which corresponds to kernel=FALSE
),
and the second one is based on a kernel representation. The latter
method is in general faster if the number of observations is small
compared to the number of variables.
Note that P=NULL
corresponds to Partial Least Squares without
penalization.
In addition, it is possible to select blocks of variables in each
iteration step of penalized PLS. The block structure is encoded in the
vector blocks
of length ncol(X)
that has the form
1,..,1,2,..,2,3,...,3,... . If select=TRUE
, the algorithm
select the weight vector with maximal penalized covariance under the
constraint that only a single block in the weight vector is
non-zero. This strategy is used for the combination of penalized PLS
and B-splines transformations.
intercept |
vector of length |
coefficients |
matrix of dimension ncol(X) x |
Nicole Kraemer
N. Kraemer, 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. http://dx.doi.org/10.1016/j.chemolab.2008.06.009
new.penalized.pls
,
penalized.pls.cv
, ppls.splines.cv
,
Penalty.matrix
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | ## example from the paper ##
# load BOD data
data(BOD)
X<-BOD[,1]
y<-BOD[,2]
Xtest=seq(min(X),max(X),length=200) # generate test data for plot
dummy<-X2s(X,Xtest,deg=3,nknot=20) # transformation of the data
Z=dummy$Z # transformed X data
Ztest=dummy$Ztest # transformed Xtest data
size=dummy$sizeZ # size of the transformed data
P<-Penalty.matrix(size,order=2) # Penalty matrix
lambda<-200 # amount of penalization
number.comp<-3 # number of components
ppls<-penalized.pls(Z,y,P=lambda*P,ncomp=number.comp) # fit
new.ppls<-new.penalized.pls(ppls,Ztest)$ypred # prediction for test data
## plot fitted values for 2 components
plot(X,y,lwd=3,xlim=range(Xtest))
lines(Xtest,new.ppls[,2])
|
Loading required package: splines
Loading required package: MASS
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.