PLS-methods {Cardinal} | R Documentation

## Partial Least Squares

### Description

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

### Usage

        ## S4 method for signature 'SImageSet,matrix'
    PLS(x, y, ncomp = 20,
            method = "nipals",
            center = TRUE,
            scale = FALSE,
            iter.max = 100, ...)

        ## S4 method for signature 'SImageSet,numeric'
    PLS(x, y, ...)

        ## S4 method for signature 'SImageSet,factor'
    PLS(x, y, ...)

        ## S4 method for signature 'SImageSet,character'
    PLS(x, y, ...)

        ## S4 method for signature 'PLS'
    predict(object, newx, newy, ...)

### 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 PLS, or a `factor` or a `character` for PLS-DA.
`ncomp` | The number of PLS components to calculate.
`method` | The function used to calculate the projection.
`center` | Should the data be centered first? This is passed to `scale`.
`scale` | Shoud the data be scaled first? This is passed to `scale`.
`iter.max` | The number of iterations to perform for the NIPALS algorithm.
`...` | Passed to the next PLS method.
`object` | The result of a previous call to `PLS`.
`newx` | An imaging dataset for which to calculate their PLS projection and predict a response from an already-calculated `PLS` object.
`newy` | Optionally, a new response from which residuals should be calcualted.

### Value

An object of class `PLS`, which is a `ResultSet`, where each component of the `resultData` slot contains at least the following components:

`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 PLS components.

`method`:

  The method used to calculate the projection.

`center`:

  The center of the dataset. Used for calculating PLS scores on new data.

`scale`:

  The scaling factors for the dataset. Used for 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.

### Author(s)

Kylie A. Bemis

### 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

`OPLS`, `PCA`, `spatialShrunkenCentroids`,

### Examples

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

    y <- factor(diag(4))

    pls <- PLS(sset, y, ncomp=1:2)

[Package Cardinal version 1.12.1 Index]