Re: [R] rank of a matrix

From: Spencer Graves <spencer.graves_at_pdf.com>
Date: Thu 05 May 2005 - 02:31:41 EST

          Have you considered something like the following:

matrix.rank <- function(A, eps=sqrt(.Machine$double.eps)){

	sv. <- abs(svd(A)$d)
	sum((sv./max(sv.))>eps)

}

matrix.rank(A=diag(3))
#[1] 3
A <- array(c(1,1,0,0), dim=c(2,2))
matrix.rank(A)
#[1] 1

mingan wrote:

>
>
> how do I check the rank of a matrix ?
>
> say
>
> A= 1 0 0
> 0 1 0
>
> then rank(A)=2
>
> what is this function?
>
> thanks
>
>
> I did try help.search("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
> Statistic
> Wilcoxon(stats) Distribution of the Wilcoxon Rank Sum
> Statistic
> friedman.test(stats) Friedman Rank Sum Test
> kruskal.test(stats) Kruskal-Wallis Rank Sum Test
> pairwise.wilcox.test(stats)
> Pairwise Wilcoxon rank sum tests
> wilcox.test(stats) Wilcoxon Rank Sum and Signed Rank Tests
>
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
> http://www.R-project.org/posting-guide.html



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Thu May 05 03:20:44 2005

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