rnk: Rank of Matrix

Description Usage Arguments Details Value Note Author(s) See Also Examples

View source: R/rnk.R

Description

Return the rank of a matrix. Not to be confused with the R function rank.

Usage

1
rnk(G, tol = 1e-14)

Arguments

G

Matrix

tol

machine tolerance for small numbers

Details

Number of singular values greater than tol.

Value

integer, number of non-zero singular values

Note

duplicate the matlab function rank

Author(s)

Jonathan M. Lees<[email protected]>

See Also

svd

Examples

1
2
3
hilbert <- function(n) { i <- 1:n; 1 / outer(i - 1, i, "+") }
X <- hilbert(9)[,1:6]
rnk(X)

PEIP documentation built on Jan. 20, 2018, 9:03 a.m.