mbplsr {rchemo} | R Documentation |
multi-block PLSR algorithms
Description
Algorithm fitting a multi-block PLS1 or PLS2 model between dependent variables Xlist
and responses Y
, based on the "Improved kernel algorithm #1" proposed by Dayal and MacGregor (1997).
For weighted versions, see for instance Schaal et al. 2002, Siccard & Sabatier 2006, Kim et al. 2011 and Lesnoff et al. 2020.
Auxiliary functions
transform
Calculates the LVs for any new matrix X
from the model.
summary
returns summary information for the model.
coef
Calculates b-coefficients from the model, adjuted for raw data.
predict
Calculates the predictions for any new matrix X
from the model.
Usage
mbplsr(Xlist, Y, blockscaling = TRUE, weights = NULL, nlv,
Xscaling = c("none", "pareto", "sd")[1], Yscaling = c("none", "pareto", "sd")[1])
## S3 method for class 'Mbplsr'
transform(object, X, ..., nlv = NULL)
## S3 method for class 'Mbplsr'
summary(object, X, ...)
## S3 method for class 'Mbplsr'
coef(object, ..., nlv = NULL)
## S3 method for class 'Mbplsr'
predict(object, X, ..., nlv = NULL)
Arguments
Xlist |
For the main function: list of training X-data ( |
X |
For the auxiliary functions: list of new X-data, with the same variables than the training X-data. |
Y |
Training Y-data ( |
blockscaling |
logical. If TRUE, the scaling factor (computed on the training) is the "norm" of the block, i.e. the square root of the sum of the variances of each column of the block. |
weights |
Weights ( |
nlv |
For the main functions: The number(s) of LVs to calculate. — For the auxiliary functions: The number(s) of LVs to consider. |
Xscaling |
vector (of length Xlist) of variable scaling for each datablock, among "none" (mean-centering only), "pareto" (mean-centering and pareto scaling), "sd" (mean-centering and unit variance scaling). If "pareto" or "sd", uncorrected standard deviation is used. |
Yscaling |
character. variable scaling for the Y-block, among "none" (mean-centering only), "pareto" (mean-centering and pareto scaling), "sd" (mean-centering and unit variance scaling). If "pareto" or "sd", uncorrected standard deviation is used. |
object |
For the auxiliary functions: A fitted model, output of a call to the main functions. |
... |
For the auxiliary functions: Optional arguments. Not used. |
Value
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 list of centering vectors of |
ymeans |
The centering vector of |
xscales |
The list of |
yscales |
The vector of |
weights |
Weights applied to the training observations. |
TT |
the X-score normalization factor. |
blockscaling |
block scaling. |
Xnorms |
"norm" of each block, i.e. the square root of the sum of the variances of each column of each block, computed on the training, and used as scaling factor |
.
U |
intermediate output. |
For transform.Mbplsr
: X-scores matrix for new Xlist-data.
For summary.Mbplsr
:
explvarx |
matrix of explained variances. |
For coef.Mbplsr
:
int |
matrix (1,nlv) with the intercepts |
B |
matrix (n,nlv) with the coefficients |
For predict.Mbplsr
:
pred |
A list of matrices ( |
References
Andersson, M., 2009. A comparison of nine PLS1 algorithms. Journal of Chemometrics 23, 518-529.
Dayal, B.S., MacGregor, J.F., 1997. Improved PLS algorithms. Journal of Chemometrics 11, 73-85.
Hoskuldsson, A., 1988. PLS regression methods. Journal of Chemometrics 2, 211-228. https://doi.org/10.1002/cem.1180020306
Kim, S., Kano, M., Nakagawa, H., Hasebe, S., 2011. Estimation of active pharmaceutical ingredients content using locally weighted partial least squares and statistical wavelength selection. Int. J. Pharm., 421, 269-274.
Lesnoff, M., Metz, M., Roger, J.M., 2020. Comparison of locally weighted PLS strategies for regression and discrimination on agronomic NIR Data. Journal of Chemometrics. e3209. https://onlinelibrary.wiley.com/doi/abs/10.1002/cem.3209
Rannar, S., Lindgren, F., Geladi, P., Wold, S., 1994. A PLS kernel algorithm for data sets with many variables and fewer objects. Part 1: Theory and algorithm. Journal of Chemometrics 8, 111-125. https://doi.org/10.1002/cem.1180080204
Schaal, S., Atkeson, C., Vijayamakumar, S. 2002. Scalable techniques from nonparametric statistics for the real time robot learning. Applied Intell., 17, 49-60.
Sicard, E. Sabatier, R., 2006. Theoretical framework for local PLS1 regression and application to a rainfall data set. Comput. Stat. Data Anal., 51, 1393-1410.
Tenenhaus, M., 1998. La régression PLS: théorie et pratique. Editions Technip, Paris, France.
Wold, S., Sjostrom, M., Eriksson, l., 2001. PLS-regression: a basic tool for chemometrics. Chem. Int. Lab. Syst., 58, 109-130.
Examples
n <- 10 ; p <- 10
Xtrain <- matrix(rnorm(n * p), ncol = p)
ytrain <- rnorm(n)
m <- 2
Xtest <- matrix(rnorm(m * p), ncol = p)
colnames(Xtrain) <- colnames(Xtest) <- paste("v", 1:p, sep = "")
Xtrain
Xtest
blocks <- list(1:2, 4, 6:8)
X1 <- mblocks(Xtrain, blocks = blocks)
X2 <- mblocks(Xtest, blocks = blocks)
nlv <- 3
fm <- mbplsr(Xlist = X1, Y = ytrain, Xscaling = c("sd","none","none"),
blockscaling = TRUE, weights = NULL, nlv = nlv)
summary(fm, X1)
coef(fm)
transform(fm, X2)
predict(fm, X2)