This function implements the Direct Orthogonal Signal Correction (DOSC) algorithm, as proposed by Westerhuis et al. (2001), to remove systematic variation from predictor variables, \(\textbf{X}\), that is orthogonal to the response variable(s), \(\textbf{Y}\).
Arguments
- x
A matrix or data frame of the predictor variables
- y
A vector, matrix or data frame of the response variable(s)
- ncomp
An integer specifying the number of principal components to retain for orthogonal processing. Default is 10.
- center
A logical value specifying whether to center the data. Default is
TRUE
.- scale
A logical value specifying whether to scale the data. Default is
FALSE
.- tol
A numeric value representing the tolerance for convergence. The default value is 1e-3.
- max_iter
An integer representing the maximum number of iterations. The default value is 10.
Value
A list with the following components:
correction
: The corrected matrix.loading
: The loadings matrix.score
: The scores matrix.
Details
Different from the Orthogonal Signal Correction (OSC) algorithm, Wold et al. (1998), the DOSC algorithm firstly orthogonalizes the matrices \(\textbf{X}\) and \(\textbf{Y}\). Then principal components analysis (PCA) is performed on the orthogonalized \(\textbf{X}\) to obtain the scores \(\textbf{T}\) and loadings \(\textbf{P}\) matrices.
References
Westerhuis, J.A., Jong, S.D., Smilde, A.K., (2001). Direct orthogonal signal correction. Chemometrics Intell. Lab. Syst., 56(1):13-25
Wold, S., Antti, H., Lindgren, F., Ohman, J. (1998). Orthogonal signal correction of near-infrared spectra. Chemometrics Intell. Lab. Syst., 44(1):175-185.