update.i_pca {idm}R Documentation

Updates a Principal Component Analysis solution

Description

This function updates the Principal Component Analysis (PCA) solution on the covariance matrix using the incremental method of Hall, Marshall & Martin (2002)

Usage

## S3 method for class 'i_pca'
update(object, incdata, current_rank, ...)

Arguments

object

object of class 'i_pca'

incdata

matrix of incoming data

current_rank

Rank of approximation or number of components to compute; if empty, the full rank is used

...

Further arguments passed to update

Value

rowpcoord

Row scores on the principal components

colpcoord

Variable loadings

eg

A list describing the eigenspace of a data matrix, with components
u Left eigenvectors
v Right eigenvectors
m Number of cases
d Eigenvalues
orgn Data mean

inertia.e

Percentages of explained variance

sv

Singular values

levelnames

Variable names

rowcor

Row squared correlations

rowctr

Row contributions

colcor

Column squared correlations

colctr

Column contributions

References

Hall, P., Marshall, D., & Martin, R. (2002). Adding and subtracting eigenspaces with eigenvalue decomposition and singular value decomposition. Image and Vision Computing, 20(13), 1009-1016.

Iodice D' Enza, A., & Markos, A. (2015). Low-dimensional tracking of association structures in categorical data, Statistics and Computing, 25(5), 1009–1022.

Iodice D'Enza, A., Markos, A., & Buttarazzi, D. (2018). The idm Package: Incremental Decomposition Methods in R. Journal of Statistical Software, Code Snippets, 86(4), 1–24. DOI: 10.18637/jss.v086.c04.

See Also

update.i_mca, i_pca, i_mca, add_es

Examples

data(segmentationData, package = "caret")
HCS = data.frame(scale(segmentationData[,-c(1:3)]))
names(HCS) = abbreviate(names(HCS), minlength = 5)
res_PCA = i_pca(HCS[1:200, ])
aa = seq(from = 201, to = nrow(HCS), by = 200)
aa[length(aa)] = nrow(HCS)+1
for (k in c(1:(length(aa)-1))){
     res_PCA = update(res_PCA, HCS[c((aa[k]):(aa[k+1]-1)),])
    }
#Static plot
plot(res_PCA, animation = FALSE)

[Package idm version 1.8.3 Index]