pls_iw: Robust PLS1 algorithm (iterative Re-Weighting)

View source: R/pls_iw.R

pls_iwR Documentation

Robust PLS1 algorithm (iterative Re-Weighting)

Description

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).

Usage


pls_iw(X, Y, ncomp, ncompw = 10, a = 3, 
                     tol = 1e-2, maxit = 10, weights = NULL)

Arguments

X

A n x p matrix or data frame of variables.

Y

A n x 1 matrix or data frame, or vector of length n, of responses.

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 (.tricube).

tol

Tolerance value for the iterative weights optimization.

maxit

Maximum number of iterations for the weights optimization.

weights

A vector of length n defining a priori weights to apply to the observations. Internally, weights are "normalized" to sum to 1. Default to NULL (weights are set to 1 / n).

Value

A list of outputs, such as:

T

The X-score matrix (n x ncomp).

P

The X-loadings matrix (p x ncomp).

W

The X-loading weights matrix (p x ncomp).

C

The Y-loading weights matrix (C = t(Beta), where Beta is the scores regression coefficients matrix).

R

The PLS projection matrix (p x ncomp).

xmeans

The centering vector of X (length p).

ymeans

The centering vector of Y (length q).

References

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

Examples


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)


mlesnoff/rnirs documentation built on April 24, 2023, 4:17 a.m.