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 components to include in the POSC model. Default is 5.
- 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 representing the tolerance for convergence. The default value is 1e-10.
- newdata
A matrix or data frame of new predictor variables to be corrected using the POSC model.
Value
If newdata is provided, a list containing the following components:
correction: The corrected matrix for the new data after applying POSC.scores: The orthogonal scores matrix for the new data. Ifnewdatais not provided, a list containing the following components:model: A list containing the POSC model components:loadings: The orthogonal loadings matrix.weights: The orthogonal weights matrix.
