This is an internal function that computes the wights required for obtaining each vector of pls scores. Implementation is done in C++ for improved performance.
get_weights(X, Y, algorithm = "pls", xls_min_w = 3L, xls_max_w = 15L)
a matrix
of one column containing the weights.
a numeric matrix of spectral data.
a matrix of one column with the response variable.
a character string indicating what method to use. Options are:
'pls'
for pls (using covariance between X and Y),
'mpls'
for modified pls (using correlation between X and Y as in
Shenk and Westerhaus, 1991; Westerhaus 2014) or
'xls'
for extended pls (as implemented in BUCHI NIRWise PLUS software).
an integer indicating the minimum window size for the "xls"
method. Only used if algorithm = 'xls'
. Default is 3 (as in BUCHI NIRWise PLUS software).
an integer indicating the maximum window size for the "xls"
method. Only used if algorithm = 'xls'
. Default is 15 (as in BUCHI NIRWise PLUS software).
Leonardo Ramirez-Lopez and Claudio Orellano
Shenk, J. S., & Westerhaus, M. O. (1991). Populations structuring of near infrared spectra and modified partial least squares regression. Crop Science, 31(6), 1548-1555.
Westerhaus, M. (2014). Eastern Analytical Symposium Award for outstanding Wachievements in near infrared spectroscopy: my contributions to Wnear infrared spectroscopy. NIR news, 25(8), 16-20.