The projected orthogonal signal correction (POSC) method is a preprocessing technique used to remove systematic variation from predictor variables that is orthogonal to the response variable. This function implements the POSC algorithm for model fitting and prediction.
Arguments
- x
A matrix or data frame of the predictor variables.
- y
A vector of the response variable.
- ncomp
An integer specifying the number of orthogonal components removed (at least 1), as in the other orthogonalization methods. The underlying PLS model has
ncomp + 1components. Default is 4.- center
A logical value indicating whether to mean-center
xandy. Default isTRUE.- scale
A logical value indicating whether to scale
xandy. Default isFALSE.- tol
A numeric value; orthogonal components whose singular value is smaller than
toltimes the largest one are discarded. The default value is 1e-10.- newdata
An optional matrix or data frame of new predictor variables to be corrected using the POSC model. It is preprocessed with the centers and scales of
x.
Value
An object of class specproc_projected_osc (a list), which predict() applies to new spectra, with the following components:
correction: The correctedx.scores: The orthogonal scores matrix \(\textbf{T}_o\).loadings: The orthogonal loadings matrix \(\textbf{P}_o\).weights: The orthogonal weights \(\textbf{W}_o\), such that \(\textbf{T}_o = \textbf{XW}_o\).center,scale: The column centers and scales applied tox.newdata: Ifnewdatais provided, a list with the corrected new data (correction) and its orthogonal scores (scores).
Details
POSC obtains OPLS-filtered data directly from an ordinary (non-orthogonalized) PLS1 model (Kemsley and Tapp, 2009):
A PLS1 model with
ncomp + 1components is fitted, giving the score matrix \(\textbf{T}\) and the fitted response \(\hat{\textbf{y}}\).The part of the score space orthogonal to \(\hat{\textbf{y}}\), \(\textbf{T} - \hat{\textbf{y}}(\hat{\textbf{y}}^T\hat{\textbf{y}})^{-1}\hat{\textbf{y}}^T\textbf{T}\), spans
ncomporthogonal components with scores \(\textbf{T}_o\).The orthogonal loadings are \(\textbf{P}_o = \textbf{X}^T\textbf{T}_o(\textbf{T}_o^T\textbf{T}_o)^{-1}\) and the filtered data are \(\textbf{X} - \textbf{T}_o\textbf{P}_o^T\).
The filtered data are identical to those obtained from an OPLS model with one
predictive and ncomp orthogonal components (opls() with the same
ncomp).
References
Kemsley, E.K., Tapp, H.S., (2009). OPLS filtered data can be obtained directly from non-orthogonalized PLS1. Journal of Chemometrics, 23(5):263-264.
Trygg, J., Wold, S., (2002). Orthogonal projections to latent structures (O-PLS). Journal of Chemometrics, 16(3):119-128.
See also
predict.specproc_filter() to correct new spectra with the fitted filter, and
step_projected_osc() to use it in a tidymodels recipe.
