Learn R Programming

ramify (version 0.3.3)

matrix_rank: Matrix Rank

Description

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

Usage

matrix_rank(x, tol)
"matrix_rank"(x, tol)
"matrix_rank"(x, tol)
"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

Run this code
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))

Run the code above in your browser using DataLab