CUR: Function to perform CUR matrix decomposition

Description Usage Arguments Value References Examples

View source: R/rCUR.R

Description

By the function the CUR matrix decomposition can be done obtaining a CURobj-class object

Usage

1
2
3
CUR(A, c=dim(A)[2], r=dim(A)[1], k=NULL, sv=NULL,
     method="random", alpha=1, weighted=FALSE, beta=4,
     matrix.return=TRUE, error.return=FALSE)

Arguments

A

a matrix for decomposition with m rows and n columns

c

column number to be selected from matrix A. Default: all columns, in this case column selection is skipped.

r

row number to be selected from matrix A. Default: all rows, in this case row selection is skipped.

k

rank parameter with perhaps k << min(m,n). Default: if not supplied, singular values accounting for 80% of the sum of the singular values is selected.

sv

the singular value decomposition of A. It is the most expensive part of the computation, so it can be supplied, if already available. Default: svd is computed on the fly.

method

the method, used, to select the rows. Possible values are

random

the original method in [Mahoney and Drineas], rows and columns are selected randomly, with the probability of selection proportional to the leverage score

exact.num.random

like random, but it is guaranteed, that exactly r rows and c columns are selected

top.scores

the rows and columns with the highest leverage scores are returned deterministically

ortho.top.scores

those rows and columns are selected, where the linear combination of the leverage score and orthogonality to the subspace of previously selected items is maximal. See parameter alpha.

highest.ranks

rows and columns with the highest rank of leverage score for some rank parameter are selected. Every possible value is tried up to the value of k. k must be larger than 1.

alpha

if method="ortho.top.scores", the coefficent of orthogonality in the linear combination. alpha=0 is equivalent to method="top.scores". The coefficent of the leverage score is always 1. Default: 1. Should be positive.

weighted

if true, leverage scores are computed with weighting by the singular values. In this case k should be set to its default value. Not used, if method=highest.ranks. Best used whith method=top.scores. See parameter beta. Default: FALSE.

beta

if weighted=TRUE, leverage scores are computed with weighting of the singular values raised to the power of beta. Default: 4.

matrix.return

if TRUE, the matrices C, U, R are returned. If matrix.return is FALSE, U is not computed, which can be expensive, if r and c are large. Default: TRUE.

error.return

if true, the Frobenius norm of the difference between the original matrix and the CUR approximation is returned. Effective only if matrix.return is TRUE. Default: FALSE.

Value

The function produces an object of CURobj-class.

References

Mahoney M. W. and Drineas P. (2009) CUR matrix decompositions for improved data analysis. PNAS, 106(3):697-702

Andras Bodor, Istvan Csabai, Michael W Mahoney and Norbert Solymosi rCUR:an R package for CUR matrix decomposition BMC Bioinformatics 2012, 13:103 doi:10.1186/1471-2105-13-103

The development was initially based on the Matlab code of Christos Boutsidis:
http://www.cs.rpi.edu/~boutsc/files/AlgorithmCUR.m

Examples

1
2
data(STTm)
CUR.results <- CUR(STTm, 31, 12, 3)

Example output

Loading required package: MASS
Loading required package: Matrix
Loading required package: lattice

rCUR documentation built on May 2, 2019, 2:21 a.m.