Learn R Programming

idm (version 1.3.1)

add_es: Adds two eigenspaces using incremental SVD (with or without mean update)

Description

This function implements two procedures for updating existing decomposition. When method="esm" it adds two eigenspaces using the incremental method of Hall, Marshall & Martin (2002). The results correspond to the eigenspace of the mean-centered and concatenated data. When method="isvd" it adds the eigenspace of an incoming data block to an existing eigenspace using the incremental singular value decomposition (SVD) method described by Zha & Simon (1999), Levy and Lindenbaum (2000), Brand (2002) and Baker (2012). New data blocks are added row-wise. The procedure can optionally keep track of the data mean using the orgn argument, as described in Ross et al. (2008) and Iodice D'Enza & Markos (2015).

Usage

add_es(eg, eg2, current_rank, orgn, ff = 0,method=c("esm","isvd"))

Arguments

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}
method
refers to the procedure being implemented: "esm" refers to the eigenspace merge (Hall et al., 2002); "isvd" refers to the incremental SVD method, with or without keeping track of the data mean.
eg2
(*)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}
current_rank
(**)Rank of approximation; if empty then rank = 2
orgn
Data mean
ff
(**)Number between 0 and 1 indicating the forgetting factor used to down-weight the contribution of earlier data blocks to the current solution. When ff = 0 (default) no forgetting occurs

Value

  • A list describing the SVD of a data matrix, with components
  • uLeft singular vectors
  • dSingular values
  • vRight singular vectors
  • mNumber of cases
  • orgnData mean; returned only if 'orgn' is given as input

References

Zha, H., & Simon, H. D. (1999). On updating problems in latent semantic indexing. SIAM Journal on Scientific Computing, 21(2), 782-791. Levy, A., & Lindenbaum, M. (2000). Sequential Karhunen-Loeve basis extraction and its application to images. IEEE Transactions on Image Processing, 9(8), 1371-1374. Brand, M. (2002). Incremental singular value decomposition of uncertain data with missing values. In Computer Vision-ECCV 2002 (pp. 707-720). Springer Berlin Heidelberg. Ross, D. A., Lim, J., Lin, R. S., & Yang, M. H. (2008). Incremental learning for robust visual tracking. International Journal of Computer Vision, 77(1-3), 125-141. Baker, C. G., Gallivan, K. A., & Van Dooren, P. (2012). Low-rank incremental methods for computing dominant singular subspaces. Linear Algebra and its Applications, 436(8), 2866-2888. Iodice D' Enza, A., & Markos, A. (2015). Low-dimensional tracking of association structures in categorical data, Statistics and Computing, 25(5), 1009-1022.

See Also

do_es, i_pca, i_mca, update.i_pca, update.i_mca

Examples

Run this code
## Example 1 - eigenspace merge (Hall et al., 2002)
#Iris species
data("iris", package = "datasets")
X = iris[,-5]
#obtain two eigenspaces
eg = do_es(X[1:50,])
eg2 = do_es(X[c(51:150),])
#add the two eigenspaces keeping track of the data mean
eg12 = add_es(method = "esm", eg, eg2)
#similar to PCA on the covariance matrix of X (SVD of the mean-centered data)

## Example 2 - incremental SVD with mean update, full rank (Ross et al., 2008)
data("iris", package = "datasets")
# obtain the eigenspace of the first 50 Iris species
X = iris[,-5]
eg = do_es(X[1:50,])
#update the eigenspace of the remaining species to
eg_new = add_es(method = "isvd",eg,data.matrix(X[c(51:150),]),orgn = eg$orgn)
#similar to PCA on the covariance matrix of X (SVD of the mean-centered data)

##Example 3 - incremental SVD with mean update, 2d approximation (Ross et al., 2008)
data("iris", package = "datasets")
# obtain the eigenspace of the first 50 Iris species
X = iris[,-5]
eg = do_es(X[1:50,])
#update the eigenspace of the remaining species to
eg = add_es(method = "isvd",eg,data.matrix(X[c(51:150),]),orgn = eg$orgn)
#similar to PCA on the covariance matrix of X (SVD of the mean-centered data)

##Example 4 - incremental SVD, full rank (Ross et al., 2008)
data("iris", package = "datasets")
#obtain the SVD of the first 50 Iris species
X = iris[,-5]
eg = svd(X[1:50,])
#update the eigenspace of the remaining species to
eg = add_es(method = "isvd",eg,data.matrix(X[c(51:150),]))
#similar results to svd(X)

Run the code above in your browser using DataLab