PCA-methods {Cardinal}R Documentation

Principal components analysis

Description

Performs principal components analysis efficiently on large datasets using implicitly restarted Lanczos bi-diagonalization (IRLBA) algorithm for approximate singular value decomposition of the data matrix.

Usage

    ## S4 method for signature 'SImageSet'
PCA(x, ncomp = 20,
        method = c("irlba", "nipals", "svd"),
        center = TRUE,
        scale = FALSE,
        iter.max = 100, ...)
    
    ## S4 method for signature 'PCA'
predict(object, newx, ...)

Arguments

x

The imaging dataset for which to calculate the principal components.

ncomp

The number of principal components to calculate.

method

The function used to calculate the singular value decomposition.

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.

...

Ignored.

object

The result of a previous call to PCA.

newx

An imaging dataset for which to calculate the principal components scores based on the aleady-calculated principal components loadings.

Value

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

scores:

A matrix with the principal component scores.

loadings:

A matrix with the principal component loadings.

sdev:

The standard deviations of the principal components.

method:

The method used to calculate the principal components.

ncomp:

The number of principal components calculated.

center:

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

scale:

The scaling factors for the dataset. Used for calculating principal components scores on new data.

Author(s)

Kylie A. Bemis

See Also

OPLS, PLS, irlba, svd

Examples

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

pca <- PCA(sset, ncomp=2)

[Package Cardinal version 2.0.4 Index]