randomSVD {RESET}R Documentation

Implementation of a sparse powered randomized singular value decomposition.

Description

Computes an approximate rank k singular value decomposition (SVD) of an n-by-p input matrix X using a sparse randomized embedding with optional subspace power iterations. The randomColumnSpace method is used to generate an rank k approximation of the column space of X. This n-by-k approximation Y is then used to create a k-by-p projection B of X onto this rank k subspace via B=Y^TX. A non-random SVD is computed for B and this SVD solution is used to generate an approximate rank k SVD of X.

Usage

    randomSVD(X, k=2, q=0, sparsity.structure=NULL, test.dist="normal")

Arguments

X

An n-by-p target matrix.

k

Target rank. Defaults to 2. See description in randomColumnSpace.

q

Number of power iterations. Defaults to 0. See description in randomColumnSpace.

sparsity.structure

Optional sparsity structure. See description in randomColumnSpace.

test.dist

Type of random variable used to populate non-sparse elements of random test matrix. See description in randomColumnSpace.

Value

List with the following elements:

See Also

randomColumnSpace

Examples

  # Simulate a 100-by-100 matrix of random Poisson data
  X = matrix(rpois(10000, lambda=2), nrow=100)
  # Create a random sparsity structure for 100-by-5 random test matrix; half elements will be 0
  sparsity.structure = sample(1:500, 250, replace=TRUE)
  # Compute rank 5 SVD of X using a sparse test matrix
  svd.out = randomSVD(X,k=5,sparsity.structure=sparsity.structure)
  # Compute using a dense test matrix with U(0,1) RVs
  svd.out = randomSVD(X,k=5,test.dist="uniform")

[Package RESET version 1.0.0 Index]