Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

matrix-rk

The Rank of a Matrix


Description

Returns the rank of a matrix.

Usage

rk(x, method = c("qr", "chol"))

Arguments

x

a numeric matrix.

method

a character string. For method = "qr" the rank is computed as qr(x)\$rank, or alternatively for method="chol" the rank is computed as attr(chol(x, pivot=TRUE), "rank").

Details

The function rk computes the rank of a matrix which is the dimension of the range of the matrix corresponding to the number of linearly independent rows or columns of the matrix, or to the number of nonzero singular values.

The rank of a matrix is also named inear map.

References

Golub, van Loan, (1996); Matrix Computations, 3rd edition. Johns Hopkins University Press.

Examples

## Create Pascal Matrix:
   P = pascal(5)
   P
   
## Compute the Rank:
   rk(P)
   rk(P, "chol")

fBasics

Rmetrics - Markets and Basic Statistics

v3042.89.1
GPL (>= 2)
Authors
Diethelm Wuertz [aut], Tobias Setz [cre], Yohan Chalabi [ctb] Martin Maechler [ctb]
Initial release
2017-11-12

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.