randsvd: randomized svd function.

View source: R/randsccan.R

randsvdR Documentation

randomized svd function.

Description

uses random matrix to estimate svd results

Usage

randsvd(A, k, seed = NA)

Arguments

A

input matrix

k

rank to use

seed

for testing

Value

randomized svd is output

Author(s)

Avants BB

References

N. Halko, P.G. Martinsson, J. Tropp "Finding structure with randomness: Stochastic algorithms for constructing approximate matrix decompositions" arXiv 0909.4061

Examples


A <- matrix(rnorm(3000), ncol = 50)
k <- 10
dr <- randsvd(A, k)$d[1:k]
dt <- svd(A)$d[1:k]
cor(dr, dt)

stnava/ANTsR documentation built on April 16, 2024, 12:17 a.m.