Learn R Programming

plsVarSel (version 0.9.12)

WVC_pls: Weighted Variable Contribution in PLS (WVC-PLS)

Description

This implements the PLS-WVC2 component dependent version of WVC from Lin et al., i.e., using Equations 14, 16 and 19. The implementation is used in T. Mehmood, S. Sæbø, K.H. Liland, Comparison of variable selection methods in partial least squares regression, Journal of Chemometrics 34 (2020) e3226. However, there is a mistake in the notation in Mehmood et al. exchanging the denominator of Equation 19 (w'X'Xw) with (w'X'Yw).

Usage

WVC_pls(y, X, ncomp, normalize = FALSE, threshold = NULL)

Value

loading weights, loadings, regression coefficients, scores and Y-loadings plus the WVC weights.

Arguments

y

Vector of responses.

X

Matrix of predictors.

ncomp

Number of components.

normalize

Divide WVC vectors by maximum value.

threshold

Set loading weights smaller than threshold to 0 and recompute component.

References

Variable selection in partial least squares with the weighted variable contribution to the first singular value of the covariance matrix, Weilu Lin, Haifeng Hang, Yingping Zhuang, Siliang Zhang, Chemometrics and Intelligent Laboratory Systems 183 (2018) 113–121.

Examples

Run this code
library(pls)
data(mayonnaise, package = "pls")
wvc <- WVC_pls(factor(mayonnaise$oil.type), mayonnaise$NIR, 10)
wvcNT <- WVC_pls(factor(mayonnaise$oil.type), mayonnaise$NIR, 10, TRUE, 0.5)
old.par <- par(mfrow=c(3,1), mar=c(2,4,1,1))
matplot(t(mayonnaise$NIR), type='l', col=1, ylab='intensity')
matplot(wvc$W[,1:3], type='l', ylab='W')
matplot(wvcNT$W[,1:3], type='l', ylab='W, thr.=0.5')
par(old.par)

Run the code above in your browser using DataLab