require(ppls) data(BOD) X<-BOD[,1] y<-BOD[,2] Xtest=seq(min(X),max(X),length=200) dummy<-X2s(X,Xtest,deg=3,nknot=20) Z<-dummy$Z Ztest<-dummy$Ztest size<-dummy$sizeZ P<-Penalty.matrix(size,order=2) lambda<-200 number.comp<-3
penalized.pls(Z,y,P=lambda*P,ncomp=number.comp)$coefficients # By default kernel=F penalized.pls(Z,y,P=lambda*P,ncomp=number.comp,kernel=TRUE)$coefficients # Same as above...?! penalized.pls.kernel(Z,y,M=lambda*P,ncomp=number.comp) # But using directly, coefficients are different. -- Mi³ego dnia [[alternative HTML version deleted]]
______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.