Learn R Programming

Cardinal (version 1.4.0)

OPLS-methods: Orthogonal Partial Least Squares

Description

Performs orthogonal partial least squares (also called orthogonal projection to latent structures or O-PLS) on an imaging dataset. This will also perform discriminant analysis (O-PLS-DA) if the response is a factor.

Usage

"OPLS"(x, y, ncomp = 20, method = "nipals", scale = FALSE, keep.Xnew = TRUE, iter.max = 100, ...)
"OPLS"(x, y, ...)
"OPLS"(x, y, ...)
"OPLS"(x, y, ...)
"predict"(object, newx, newy, keep.Xnew = TRUE, ...)

Arguments

x
The imaging dataset on which to perform partial least squares.
y
The response variable, which can be a matrix or a vector for ordinary O-PLS, or a factor or a character for O-PLS-DA.
ncomp
The number of O-PLS components to calculate.
method
The function used to calculate the projection.
scale
Shoud the data be scaled first? This is passed to scale.
keep.Xnew
Should the new data matrix be kept after filtering out the orthogonal variation?
iter.max
The number of iterations to perform for the NIPALS algorithm.
...
Passed to the next OPLS method.
object
The result of a previous call to OPLS.
newx
An imaging dataset for which to calculate their OPLS projection and predict a response from an already-calculated OPLS object.
newy
Optionally, a new response from which residuals should be calculated.

Value

An object of class OPLS, which is a ResultSet, where each component of the resultData slot contains at least the following components:
Xnew:
A new data matrix that has been filtered of the orthogonal variation.
Xortho:
A new data matrix that consists of only the orthogonal variation.
Oscores:
A matrix with the orthogonal component scores for the explanatary variable.
Oloadings:
A matrix objects with the orthogonal explanatory variable loadings.
Oweights:
A matrix with the orthgonal explanatory variable weights.
scores:
A matrix with the component scores for the explanatary variable.
loadings:
A matrix with the explanatory variable loadings.
weights:
A matrix with the explanatory variable weights.
Yscores:
A matrix objects with the component scores for the response variable.
Yweights:
A matrix objects with the response variable weights.
projection:
The projection matrix.
coefficients:
The matrix of the regression coefficients.
ncomp:
The number of O-PLS components.
method:
The method used to calculate the projection.
center:
The center of the dataset. Used for calculating O-PLS scores on new data.
scale:
The scaling factors for the dataset. Used for O-PLS scores on new data.
Ycenter:
The centers of the response variables. Used for predicting new observations.
Yscale:
The scaling factors for the response variables. Used for predicting new observation.
fitted:
The fitted response.

References

Trygg, J., & Wold, S. (2002). Orthogonal projections to latent structures (O-PLS). Journal of Chemometrics, 16(3), 119-128. doi:10.1002/cem.695

See Also

PLS, PCA, spatialShrunkenCentroids,

Examples

Run this code
sset <- generateImage(diag(4), range=c(200, 300), step=1)

y <- factor(diag(4))

opls <- OPLS(sset, y, ncomp=1:2)

Run the code above in your browser using DataLab