Crossvalidation (CV) is carried out with robust PLS based on partial robust Mregression. A plot with the choice for the optimal number of components is generated. This only works for univariate ydata.
1 2 
X 
predictor matrix 
y 
response variable 
a 
number of PLS components 
fairct 
tuning constant, by default fairct=4 
opt 
if "l1m" the mean centering is done by the l1median, otherwise by the coordinatewise median 
subset 
optional vector defining a subset of objects 
segments 
the number of segments to use or a list with segments (see

segment.type 
the type of segments to use. Ignored if 'segments' is a list 
trim 
trimming percentage for the computation of the SEP 
sdfact 
factor for the multiplication of the standard deviation for
the determination of the optimal number of components, see

plot.opt 
if TRUE a plot will be generated that shows the selection of the
optimal number of components for each step of the CV, see

A function for robust PLS based on partial robust Mregression is available at
prm
. The optimal number of robust PLS components is chosen according
to the following criterion: Within the CV scheme, the mean of the trimmed SEPs
SEPtrimave is computed for each number of components, as well as their standard
errors SEPtrimse. Then one searches for the minimum of the SEPtrimave values and
adds sdfact*SEPtrimse. The optimal number of components is the most parsimonious
model that is below this bound.
predicted 
matrix with length(y) rows and a columns with predicted values 
SEPall 
vector of length a with SEP values for each number of components 
SEPtrim 
vector of length a with trimmed SEP values for each number of components 
SEPj 
matrix with segments rows and a columns with SEP values within the CV for each number of components 
SEPtrimj 
matrix with segments rows and a columns with trimmed SEP values within the CV for each number of components 
optcomp 
final optimal number of PLS components 
SEPopt 
trimmed SEP value for final optimal number of PLS components 
Peter Filzmoser <P.Filzmoser@tuwien.ac.at>
K. Varmuza and P. Filzmoser: Introduction to Multivariate Statistical Analysis in Chemometrics. CRC Press, Boca Raton, FL, 2009.
1 2 3 
Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.
Please suggest features or report bugs with the GitHub issue tracker.
All documentation is copyright its authors; we didn't write any of that.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.