[R-SIG-Mac] NaN and linear algebra

David Firth d.firth at warwick.ac.uk
Wed Mar 16 12:57:02 CET 2005


I don't know whether this is a bug, or a problem with the way I built R 
2.0.1 (under Mac OS 10.3 on a G5), or something else.  Can anyone else 
confirm (or otherwise) that this happens in their R 2.0.1 on Mac OS X?

 >  d<-matrix(NaN,3,3)
 >  d
     [,1] [,2] [,3]
[1,]  NaN  NaN  NaN
[2,]  NaN  NaN  NaN
[3,]  NaN  NaN  NaN
 >  solve(d)
Error in solve.default(d) : Lapack routine dgesv: system is exactly 
singular
 >  chol(d)
Error in chol(d) : the leading minor of order 1 is not positive definite
 >  det(d)
[1] 0

Doing the same thing on a Windows setup gave a different (and more 
useful, I think) result

 > d<-matrix(NaN,3,3)
 > d
     [,1] [,2] [,3]
[1,]  NaN  NaN  NaN
[2,]  NaN  NaN  NaN
[3,]  NaN  NaN  NaN
 > solve(d)
     [,1] [,2] [,3]
[1,]  NaN  NaN  NaN
[2,]  NaN  NaN  NaN
[3,]  NaN  NaN  NaN
 > chol(d)
     [,1] [,2] [,3]
[1,]  NaN  NaN  NaN
[2,]    0  NaN  NaN
[3,]    0    0  NaN
 > det(d)
[1] NaN

Any thoughts?
David

Professor David Firth
Dept of Statistics
University of Warwick
Coventry CV4 7AL
United Kingdom

Voice: +44 (0)247 657 2581
Fax:   +44 (0)247 652 4532
Web:   http://www.warwick.ac.uk/go/dfirth



More information about the R-SIG-Mac mailing list