RE: [R] rank of a matrix

From: Huntsinger, Reid <>
Date: Thu 05 May 2005 - 03:18:23 EST

qr() returns an estimate of the rank. However the rank of a matrix isn't really computable (or useful) in general in finite precision arithmetic. The Hilbert matrix example (from help(svd)) is a good illustration:

> hilbert <- function(n) { i <- 1:n; 1 / outer(i - 1, i, "+") }
> qr(hilbert(9))$rank

[1] 7

but it's actually an invertible 9 x 9 matrix.

Rather you can estimate how far a matrix is from having rank <= k for example. A book on numerical linear algebra would be a good reference.

A common approach to statistical analysis of certain kinds of data deals with the ranks of the data values, and that's why you got so many hits for "rank".

Reid Huntsinger

-----Original Message-----
[] On Behalf Of mingan Sent: Wednesday, May 04, 2005 11:54 AM
Subject: [R] rank of a matrix

how do I check the rank of a matrix ?


A= 1 0 0

     0 1 0

then rank(A)=2

what is this function?


  I did try"rank"), but all the returned help information seem irrelevant to what I want.

  I would like to know how people search for help information like this.

rank(base)              Sample Ranks
SignRank(stats)         Distribution of the Wilcoxon Signed Rank
Wilcoxon(stats)         Distribution of the Wilcoxon Rank Sum
friedman.test(stats)    Friedman Rank Sum Test
kruskal.test(stats)     Kruskal-Wallis Rank Sum Test
                        Pairwise Wilcoxon rank sum tests
wilcox.test(stats)      Wilcoxon Rank Sum and Signed Rank Tests

______________________________________________ mailing list PLEASE do read the posting guide! mailing list PLEASE do read the posting guide! Received on Thu May 05 03:49:33 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:31:35 EST