Skip to contents

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.

Usage

projected_osc(
  x,
  y,
  ncomp = 5,
  center = TRUE,
  scale = FALSE,
  tol = 1e-10,
  newdata = NULL
)

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 x and y. Default is TRUE.

scale

A logical value indicating whether to scale x and y. Default is FALSE.

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. If newdata is 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.

Author

Christian L. Goueguel