matrix_rank: Matrix Rank

Description Usage Arguments Details Examples

Description

Compute the rank of a matrix using the singular value decomposition (SVD) method.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
matrix_rank(x, tol)

## Default S3 method:
matrix_rank(x, tol)

## S3 method for class 'matrix'
matrix_rank(x, tol)

## S3 method for class 'data.frame'
matrix_rank(x, tol)

Arguments

x

an object that inherits from class "matrix".

tol

Threshold below which SVD values are considered zero.

Details

The singular value decomposition method simply computes the SVD of x and returns the number of singular values of x that are greater than tol. See the function rankMatrix in package Matrix for alternative methods.

Examples

1
2
3
4
5
matrix_rank(1:5)
matrix_rank(randn(2, 2))
matrix_rank(cbind(c(1, 1, 1), c(2, 2, 2)))
matrix_rank(ones(3, 3))
matrix_rank(zeros(3, 5))

bgreenwell/ramify documentation built on May 12, 2019, 8:20 p.m.