PCA-methods {Cardinal} | R Documentation |
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.
## S4 method for signature 'SparseImagingExperiment' PCA(x, ncomp = 3, center = TRUE, scale = FALSE, ...) ## S4 method for signature 'PCA2' predict(object, newx, ncomp, ...) ## S4 method for signature 'PCA2' summary(object, ...) ## S4 method for signature 'SImageSet' PCA(x, ncomp = 3, method = c("irlba", "nipals", "svd"), center = TRUE, scale = FALSE, iter.max = 100, ...) ## S4 method for signature 'PCA' predict(object, newx, ...)
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 |
Shoud the data be scaled first? This is passed to |
iter.max |
The number of iterations to perform for the NIPALS algorithm. |
... |
Ignored. |
object |
The result of a previous call to |
newx |
An imaging dataset for which to calculate the principal components scores based on the aleady-calculated principal components loadings. |
An object of class PCA2
, which is a ResultImagingExperiment
, or an object of class PCA
, which is a ResultSet
. Each elemnt of resultData
slot contains at least the following components:
loadings
:A matrix with the principal component loadings.
scores
:A matrix with the principal component scores.
sdev
:The standard deviations of the principal components.
Kylie A. Bemis
register(SerialParam()) set.seed(1) data <- simulateImage(preset=2, npeaks=20, dim=c(6,6), representation="centroid") # project to FastMap components pca <- PCA(data, ncomp=2) # visualize first 2 components image(pca, superpose=FALSE)