Package svd. R topics documented: September 26, 2017

Similar documents
Package svd. R topics documented: March 24, Type Package. Title Interfaces to various state-of-art SVD and eigensolvers. Version 0.3.

Package RSpectra. May 23, 2018

Package irlba. January 11, 2018

Package ECctmc. May 1, 2018

Package rmumps. September 19, 2017

Package Rtsne. April 14, 2017

Package exporkit. R topics documented: May 5, Type Package Title Expokit in R Version Date

Package qap. February 27, Index 5. Solve Quadratic Assignment Problems (QAP)

Package crochet. January 8, 2018

Package esabcv. May 29, 2015

Package subplex. April 5, 2018

Package nsprcomp. August 29, 2016

Package stapler. November 27, 2017

Package mixsqp. November 14, 2018

Package messaging. May 27, 2018

Package nmslibr. April 14, 2018

Package geogrid. August 19, 2018

Package canvasxpress

Package jdx. R topics documented: January 9, Type Package Title 'Java' Data Exchange for 'R' and 'rjava'

Package ECOSolveR. February 18, 2018

Package rmumps. December 18, 2017

Package readobj. November 2, 2017

Package slam. December 1, 2016

Package crossrun. October 8, 2018

Package rmatio. July 28, 2017

Package filematrix. R topics documented: February 27, Type Package

Package glinternet. June 15, 2018

Package logisticpca. R topics documented: August 29, 2016

Package clustering.sc.dp

Package kexpmv. January 11, 2018

Package slam. February 15, 2013

Package fastrtext. December 10, 2017

Package blockmatrix. February 19, 2015

Package clipr. June 23, 2018

Package nngeo. September 29, 2018

Package narray. January 28, 2018

Table 1.1 Installation.

Package tropicalsparse

Package anomalydetection

Package pairsd3. R topics documented: August 29, Title D3 Scatterplot Matrices Version 0.1.0

Package pkgbuild. October 16, 2018

Package fastdummies. January 8, 2018

Package raker. October 10, 2017

Package flsa. February 19, 2015

Package dotcall64. January 11, 2018

Matrix algebra. Basics

Package projector. February 27, 2018

Package oec. R topics documented: May 11, Type Package

Package d3plus. September 25, 2017

Package elmnnrcpp. July 21, 2018

Package benchmarkme. R topics documented: February 26, Type Package Title Crowd Sourced System Benchmarks Version 0.2.

Package quadprogxt. February 4, 2018

Package MmgraphR. R topics documented: September 14, Type Package

Package spark. July 21, 2017

Package sparsehessianfd

Package profvis. R topics documented:

Package Rglpk. May 18, 2017

Package eply. April 6, 2018

Package r.jive. R topics documented: April 12, Type Package

Package PUlasso. April 7, 2018

Package htmltidy. September 29, 2017

Package lxb. R topics documented: August 29, 2016

Package ompr. November 18, 2017

Package jstree. October 24, 2017

CALCULATING RANKS, NULL SPACES AND PSEUDOINVERSE SOLUTIONS FOR SPARSE MATRICES USING SPQR

SLEPc: Scalable Library for Eigenvalue Problem Computations

Package MeanShift. R topics documented: August 29, 2016

Package GenSA. R topics documented: January 17, Type Package Title Generalized Simulated Annealing Version 1.1.

Package orthogonalsplinebasis

Package recosystem. September 2, 2017

Package SSLASSO. August 28, 2018

Package slickr. March 6, 2018

Package gamlss.spatial

Package RODBCext. July 31, 2017

Package zoomgrid. January 3, 2019

Package kdtools. April 26, 2018

Package d3heatmap. February 1, 2018

Package hiernet. March 18, 2018

Package geojsonsf. R topics documented: January 11, Type Package Title GeoJSON to Simple Feature Converter Version 1.3.

Package widyr. August 14, 2017

Package vdiffr. April 27, 2018

Package pdfsearch. July 10, 2018

Package sglr. February 20, 2015

Package RcppEigen. February 7, 2018

Package iterators. December 12, 2017

Package ssa. July 24, 2016

Package lexrankr. December 13, 2017

nu TRLan User Guide version 1.0

Package NNLM. June 18, 2018

Package pomdp. January 3, 2019

Package Rcsdp. April 25, 2016

Package dbx. July 5, 2018

Package glcm. August 29, 2016

Package GADAG. April 11, 2017

Package nscancor. February 15, 2018

Package assertive.code

Package robotstxt. November 12, 2017

Package BiocManager. November 13, 2018

Package SAENET. June 4, 2015

Package collapsibletree

Transcription:

Package svd September 26, 2017 Type Package Imports methods Suggests testthat (>= 0.7) Title Interfaces to Various State-of-Art SVD and Eigensolvers Version 0.4.1 Author Anton Korobeynikov [aut, cre], Rasmus Munk Larsen [ctb, cph], Lawrence Berkeley National Laboratory [ctb, cph] Maintainer Anton Korobeynikov <anton@korobeynikov.info> R bindings to SVD and eigensolvers (PROPACK, nutrlan). License BSD_3_clause + file LICENSE Copyright see file COPYRIGHTS URL http://github.com/asl/svd NeedsCompilation yes Repository CRAN Date/Publication 2017-09-25 22:06:23 UTC R topics documented: eigen............................................. 2 extmat............................................ 3 extmat-class......................................... 4 svd.............................................. 5 Index 7 1

2 eigen eigen Generic Eigendecomposition of a Matrix Compute the set of eigenvalues and eigenvectors decomposition of a real or complex rectangular matrix. Usage trlan.eigen(x, neig = min(m, n), opts = list(), lambda = NULL, U = NULL) ztrlan.eigen(x, neig = min(m, n), opts = list(), lambda = NULL, U = NULL) Arguments X neig opts lambda U the matrix to be decomposed. This can be either normal matrix or external matrix object (e.g. one, created via extmat function). number of desired eigentriples different options for eigensolver. See Details section for more information set of already computed singular values (used for continuation of the decomposition). matrix of already computed eigenvectors (used for continuation of the decomposition). Details Value These routines provides an interface to state-of-art implementation of eigensolver. In particular, nu-trlan does the thick-restart Lanczos eigendecomposition of a matrix. opts is a list of different options which can be passed to the routines. Note that by default more or less suitable values for these options are set by the routines automatically. The options for nu-trlan are: kmax integer, maximum number of iterations. maxiter integer. maximum number of matrix-vector products. tol numeric, tolerance level. verbose integer, verboseness level. The returned value is a list with components d u a vector containing the eigenvalues of X a matrix whose columns contain the eigenvectors of X

extmat 3 References Wu, K. and Simon, H. (2000). Thick-restart Lanczos method for large symmetric eigenvalue problems. SIAM J. Matrix Anal. Appl. 22, 2, 602-616. Yamazaki, I., Bai, Z., Simon, H., Wang, L.-W., and Wu, K. (2008). Adaptive projection subspace dimension for the thick restart Lanczos method. Tech. rep., Lawrence Berkeley National Laboratory, University of California, One Cyclotron road, Berkeley, California 94720. Korobeynikov, A. (2010) Computation- and space-efficient implementation of SSA. Statistics and Its Interface, Vol. 3, No. 3, Pp. 257-268 extmat External matrices operations. A set of routines to operate on "external" matrices. Usage is.extmat(x) extmat.ncol(x) extmat.nrow(x) extmat(mul, tmul, nrow, ncol, env = parent.frame()) ematmul(emat, v, transposed = FALSE) Arguments X, emat matrix to operate on mul tmul nrow ncol env transposed v Details function performing the multiplication of matrix to vector function performing the multiplication of transposed matrix to vector number of rows of the matrix number of columns of the matrix environment, where matrix-vector multiplication function call is evaluated in logical, if TRUE the multiplication is performed with the transposed matrix. vector to multiply with. These routines checks whether the given external pointer actually points to "external matrix" structure and allow to extract the number of columns and rows respectively. extmat is a convenient wrapper which allows one provide just the routines which will multiply with matrix and the transposed one (e.g. if the matrix is sparse or structured) and allow to use the SVD routines of the package

4 extmat-class Value See Also Object extmat class extmat Examples ## Not run: library(matrix) f <- function(v) as.numeric(a %*% v) # Convert Matrix object back to vector tf <- function(v) as.numeric(ta %*% v) # Convert Matrix object back to vector e <- new.env() assign("a", USCounties, e) assign("ta", t(uscounties), e) environment(f) <- e environment(tf) <- e m <-extmat(f, tf, nrow(uscounties), ncol(uscounties)) system.time(v1 <- propack.svd(m, neig = 10)) # 0.252 0.007 0.259 system.time(v2 <- propack.svd(as.matrix(uscounties), neig = 10)) # 8.563 0.027 8.590 ## End(Not run) # The largest eigenvalue and the corresponding eigenvector of a Hilbert matrix h <- outer(1:5000, 1:5000, function(i, j) 1 / (i + j - 1)) v1 <- trlan.eigen(h, neig = 1) # Same, but using complex numbers v2 <- ztrlan.eigen(h, neig = 1) print(c(v1$d, v2$d)) extmat-class Class "extmat" extmat is a convenient wrapper which allows one provide just the routines which will multiply with matrix and the transposed one (e.g. if the matrix is sparse or structured) and allow to use the SVD routines of the package. This S4 wrapper allows the use of usual matrix operations on such objects. Objects from the Class Objects can be created by calls of the form extmat(mul, tmul, nrow, ncol, env = parent.frame()).

svd 5 See Also extmat Examples ## Not run: library(matrix) f <- function(v) as.numeric(a %*% v) # Convert Matrix object back to vector tf <- function(v) as.numeric(ta %*% v) # Convert Matrix object back to vector e <- new.env() assign("a", USCounties, e) assign("ta", t(uscounties), e) environment(f) <- e environment(tf) <- e m <-extmat(f, tf, nrow(uscounties), ncol(uscounties)) system.time(v1 <- propack.svd(m, neig = 10)) # 0.252 0.007 0.259 system.time(v2 <- propack.svd(as.matrix(uscounties), neig = 10)) # 8.563 0.027 8.590 ## End(Not run) svd Generic Singular Value Decomposition of a Matrix Compute the singular-value decomposition of a real or complex rectangular matrix. Usage propack.svd(x, neig = min(m, n), opts = list()) trlan.svd(x, neig = min(m, n), opts = list(), lambda = NULL, U = NULL) ztrlan.svd(x, neig = min(m, n), opts = list(), lambda = NULL, U = NULL) Arguments X neig opts lambda U the matrix to be decomposed. This can be either normal matrix or external matrix object (e.g. one, created via extmat function). number of desired eigentriples different options for eigensolver. See Details section for more information set of already computed singular values (used for continuation of the decomposition). matrix of already computed eigenvectors (used for continuation of the decomposition).

6 svd Details Value These routines provides an interface to two state-of-art implementations of truncated SVD. PROPACK does this via the implicitly restarted Lanczos bidiagonalization with partial reorthogonalization. nu-trlan does the thick-restart Lanczos eigendecomposition of cross-product matrix. opts is a list of different options which can be passed to the routines. Note that by default more or less suitable values for these options are set by the routines automatically. The options for PROPACK are: kmax integer, maximum number of iterations. dim integer, dimension of Krylov subspace. p integer, number of shifts per restart. maxiter integer. maximum number of restarts. tol numeric, tolerance level. verbose logical, if TRUE, provide verbose output. The options for nu-trlan are: kmax integer, maximum number of iterations. maxiter integer. maximum number of matrix-vector products. tol numeric, tolerance level. verbose integer, verboseness level. The returned value is a list with components d u v a vector containing the singular values of x a matrix whose columns contain the left singular vectors of X a matrix whose columns contain the right singular vectors of X (only for propack.svd ) References Wu, K. and Simon, H. (2000). Thick-restart Lanczos method for large symmetric eigenvalue problems. SIAM J. Matrix Anal. Appl. 22, 2, 602-616. Yamazaki, I., Bai, Z., Simon, H., Wang, L.-W., and Wu, K. (2008). Adaptive projection subspace dimension for the thick restart Lanczos method. Tech. rep., Lawrence Berkeley National Laboratory, University of California, One Cyclotron road, Berkeley, California 94720. Larsen, R. M. (1998). Efficient algorithms for helioseismic inversion. Ph.D. thesis, University of Aarhus, Denmark. Korobeynikov, A. (2010) Computation- and space-efficient implementation of SSA. Statistics and Its Interface, Vol. 3, No. 3, Pp. 257-268

Index Topic algebra eigen, 2 svd, 5 Topic array eigen, 2 svd, 5 Topic classes extmat-class, 4 %*%,extmat,extmat-method %*%,extmat,matrix-method %*%,extmat,numeric-method %*%,matrix,extmat-method %*%,numeric,extmat-method as.array,extmat-method as.integer,extmat-method as.logical,extmat-method as.matrix,extmat-method (extmat-class), 4 as.numeric,extmat-method as.vector,extmat-method (extmat-class), 4 eigen, 2 ematmul (extmat), 3 extmat, 3, 4, 5 extmat-class, 4 is.extmat (extmat), 3 length,extmat-method propack.svd (svd), 5 svd, 5 t,extmat-method tcrossprod,any,extmat-method tcrossprod,extmat,any-method tcrossprod,extmat,extmat-method tcrossprod,extmat,missing-method trlan.eigen (eigen), 2 trlan.svd (svd), 5 ztrlan.eigen (eigen), 2 ztrlan.svd (svd), 5 crossprod,any,extmat-method crossprod,extmat,any-method crossprod,extmat,extmat-method crossprod,extmat,missing-method dim,extmat-method 7