[R] solve computationally singular

Ravi Varadhan rvaradhan at jhmi.edu
Tue Nov 7 23:25:23 CET 2006


For heaven's sake, please stop sending repeat emails and send your R code
that can reproduce the error.

Ravi. 

----------------------------------------------------------------------------
-------

Ravi Varadhan, Ph.D.

Assistant Professor, The Center on Aging and Health

Division of Geriatric Medicine and Gerontology 

Johns Hopkins University

Ph: (410) 502-2619

Fax: (410) 614-9625

Email: rvaradhan at jhmi.edu

Webpage:  http://www.jhsph.edu/agingandhealth/People/Faculty/Varadhan.html

 

----------------------------------------------------------------------------
--------

-----Original Message-----
From: r-help-bounces at stat.math.ethz.ch
[mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of xchen
Sent: Tuesday, November 07, 2006 2:46 PM
To: r-help at stat.math.ethz.ch
Subject: [R] solve computationally singular

Hi uRsers,

when inverting a 2 by 2 matrix using solve, I encountered a error message:
solve.default(sigma, tol = 1e-07) :
        system is computationally singular: reciprocal condition number 
= 1.7671e-017

and then I test the determinant of this matrix: 6.341393e-06.

In my program, I have a condition block that whether a matrix is 
invertible like this:
if(det(sigma)<1e-7) return NULL;

but this seems doesnot work to prevent the singularity when inverting a 
matrix. I am some confused about the relationship between "reciprocal 
condition number" and determinant. Can anybody give me some idea how to 
prevent this situation?

Thanks a lot!

Xiaohui

______________________________________________
R-help at 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
and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list