Skip to content

Rank of Matrix

4 messages · Indrajit Sengupta, Christian Hennig, Thomas Lumley +1 more

#
Hello everybody,
I think my question has been asked before but I am posing it once again
since I need it. Is there any way to find the rank of a matrix in R or
Splus?

______________________
Indrajit SenGupta
Department Of Statistics
St. Xavier's College
Calcutta University
mailto:indra_calisto at yahoo.com
mailto:indrajitsg at vsnl.net



_________________________________________________________



-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
#
On Tue, 19 Feb 2002, Indrajit SenGupta wrote:

            
See function qr. Note that the rank is numerically unstable.

  
    
#
On Tue, 19 Feb 2002, Indrajit SenGupta wrote:

            
yes, it has been asked quite recently.

You can use either qr(), there's an example in help(qr) or use svd() and
count the number of non-zero singular values. Deciding the right tolerance
for counting a singular value as zero is not trivial -- any matrix is
arbitrarily close to full rank matrices in almost any reasonable metric.

	-thomas

Thomas Lumley			Asst. Professor, Biostatistics
tlumley at u.washington.edu	University of Washington, Seattle



-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
#
Use svd() to get the singular values and count up how many are greater
than the machine precision multiplied by the largest singular value. 
Simon
  ______________________________________________________________________
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._