A function to fit Generalized partial least squares models.
Partial least squares is a commonly used dimension reduction technique. The paradigm can be extended to include generalized linear models in several different ways. The code in this function uses the extension proposed by Ding and Gentleman, 2004.
gpls(x, ...)"gpls"(x, y, K.prov=NULL, eps=1e-3, lmax=100, b.ini=NULL, denom.eps=1e-20, family="binomial", link=NULL, br=TRUE, ...)"gpls"(formula, data, contrasts=NULL, K.prov=NULL, eps=1e-3, lmax=100, b.ini=NULL, denom.eps=1e-20, family="binomial", link=NULL, br=TRUE, ...)
- The matrix of covariates.
- A formula of the form 'y ~ x1 + x2 + ...', where
yis the response and the other terms are covariates.
- The vector of responses
- A data.frame to resolve the forumla, if used
- number of PLS components, default is the rank of X
- tolerance for convergence
- maximum number of iteration allowed
- initial value of regression coefficients
- small quanitity to guarantee nonzero denominator in deciding convergence
- glm family,
binomialis the only relevant one here
- link function,
logitis the only one practically implemented now
- TRUE if Firth's bias reduction procedure is used
- Additional arguements.
- an optional list. See the
This is a different interface to the functionality provided by
glpls1a. The interface is intended to be simpler to use
and more consistent with other matchine learning code in R.
The technology is intended to deal with two class problems where
there are more predictors than cases. If a response variable
y) is used that has more than two levels the behavior may
An object of class
- The estimated coefficients.
- A boolean indicating whether convergence was achieved.
- The total number of iterations.
- A boolean indicating whether Firth's procedure was used.
familyargument that was passed in.
linkargument that was passed in.
- The constructed terms object.
- The call
- The factor levels for prediction.
gplswith the following components:
- Ding, B.Y. and Gentleman, R. (2003) Classification using generalized partial least squares.
- Marx, B.D (1996) Iteratively reweighted partial least squares estimation for generalized linear regression. Technometrics 38(4): 374-381.
library(MASS) m1 = gpls(type~., data=Pima.tr, K=3)