mvr {pls.pcr} | R Documentation |
Generic function for multivariate regression. PCR and two
types of PLS (SIMPLS and kernel-PLS) are implemented. The functions
pcr
and pls
are simple wrappers for mvr
.
Cross-validation can be used; a nmber of latent variables
to retain is suggested.
mvr(X, Y, ncomp=1:min(nobj, nvar), method=c("PCR", "SIMPLS", "kernelPLS"), validation=c("none","CV"), grpsize, niter) pcr(...) pls(..., method)
X |
a matrix of observations. NA s and Inf s are not
allowed. |
Y |
a vector or matrix of responses. NA s and Inf s
are not allowed. |
ncomp |
the numbers of latent variables to be assessed in the
modelling. Default is from one to the rank of X . |
method |
the multivariate regression method to be used. |
validation |
validation method, either "none" or cross-validation ("CV"). |
grpsize |
the group size for the "CV" validation. If not
specified, this is determined by the niter parameter. |
niter |
the number of iterations in the
cross-validation. Default: 10. If both niter and
grpsize are specified, niter takes precedence. |
... |
arguments for mvr . |
An object of class mvr
is returned. This has the following
components:
X |
original X data matrix. |
Y |
original Y data. Y is represented as a matrix, possibly with only one column. |
ncomp |
the number of latent variables considered in the PCR regression. |
method |
the method used. |
training |
a list with the following components:
ncomp . The dimensions of B are
c(nvar, npred, length(ncomp)) with nvar the number
of X variables and npred the number of variables to be
predicted in Y .
ncomp . |
validat |
a list with the following components:
ncomp . |
pcr.model
, simpls
,
kernelpls
, plot.mvr
,
summary.mvr
data(NIR) attach(NIR) NIR.pcr <- mvr(Xtrain, Ytrain, 1:6, validation="CV") NIR.simpls <- mvr(Xtrain, Ytrain, 1:6, validation="CV", method="SIMPLS") NIR.kernelpls <- mvr(Xtrain, Ytrain, 1:6, validation="CV", method="kernelPLS")