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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Rank of Matrix
4 messages · Indrajit Sengupta, Christian Hennig, Thomas Lumley +1 more
On Tue, 19 Feb 2002, Indrajit SenGupta wrote:
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?
See function qr. Note that the rank is numerically unstable.
______________________ 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
*********************************************************************** Christian Hennig Seminar fuer Statistik, ETH-Zentrum (LEO), CH-8092 Zuerich (current) and Fachbereich Mathematik-SPST/ZMS, Universitaet Hamburg hennig at stat.math.ethz.ch, http://stat.ethz.ch/~hennig/ hennig at math.uni-hamburg.de, http://www.math.uni-hamburg.de/home/hennig/ ####################################################################### ich empfehle www.boag.de -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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:
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?
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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
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?
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 ______________________________________________________________________
Simon Wood snw at st-and.ac.uk http://www.ruwpa.st-and.ac.uk/simon.html The Mathematical Institute, North Haugh, St. Andrews, Fife KY16 9SS UK Direct telephone: (0)1334 463799 Indirect fax: (0)1334 463748
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._