pls_iw | R Documentation |
A robust PLS1 algorithm using iterave reweighted PLS. The weights of the row observations are iteratively calculated from a X-outlyingness measure (computed in a PLS score space) and the PLS y-residuals.
This is a simplified and slightly modified version of the robuts PLSR algorithm "PRM" of Serneels et al. 2005. See the related article for details, and the code of pls_iw
which is very comprehensive.
Compared to PRM, two modifications are proposed in pls_iw
:
- The weights of the row observations are optimzed for a single given number of components, ncompw
, set by the user. In PRM, the weights are optimized for each number of PLS components which is very time expensive (and which generates as many models as the total number of PLS components considered).
- The weight function is the tricubic function such as in Cleveland & Devlin (1988).
Matrix X
is centered before the analyses, but X
is not column-wise scaled (there is no argument scale
available). If a scaling is needed, the user has to scale X
before using the functions.
Row observations can receive additionnal a priori weights (using argument weights
).
pls_iw(X, Y, ncomp, ncompw = 10, a = 3,
tol = 1e-2, maxit = 10, weights = NULL)
X |
A |
Y |
A |
ncomp |
The maximal number of scores (components = latent variables) to be calculated in the final PLS. |
ncompw |
The number of scores used for optimizing the WPLS weights. |
a |
The cutoff value for the tricubic weight function ( |
tol |
Tolerance value for the iterative weights optimization. |
maxit |
Maximum number of iterations for the weights optimization. |
weights |
A vector of length |
A list of outputs, such as:
T |
The X-score matrix ( |
P |
The X-loadings matrix ( |
W |
The X-loading weights matrix ( |
C |
The Y-loading weights matrix (C = t(Beta), where Beta is the scores regression coefficients matrix). |
R |
The PLS projection matrix ( |
xmeans |
The centering vector of |
ymeans |
The centering vector of |
Cleveland, W.S., Devlin, S.J., 1988. Locally Weighted Regression: An Approach to Regression Analysis by Local Fitting. Journal of the American Statistical Association 83, 596â610. https://doi.org/10.1080/01621459.1988.10478639
Serneels, S., Croux, C., Filzmoser, P., Van Espen, P.J., 2005. Partial robust M-regression. Chemometrics and Intelligent Laboratory Systems 79, 55-64. https://doi.org/10.1016/j.chemolab.2005.04.007
n <- 8
p <- 6
set.seed(1)
X <- matrix(rnorm(n * p, mean = 10), ncol = p, byrow = TRUE)
y <- 100 * rnorm(n)
set.seed(NULL)
pls_iw(X, y, ncomp = 3)
fm <- plsr(X, y, X, ncomp = 3, algo = pls_iw, ncompw = 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.