Skip to content
Prev 15532 / 63424 Next

NaN and linear algebra

On Mar 22, 2005, at 6:19 PM, Bill Northcott wrote:

            
For the record: this is the behavior on all platforms I tested (Mac,  
Linux, IRIX) - the only platform with a different result is  
reportedly Windows. So what I was saying is that this is not  
"IEEE-754 non-compliance of MacOS X" as you put it.
That's exactly what I was pointing out, and, yes, this is a bug in  
vecLib.

@Martin: I guess the most simple test for this would be probably
is.nan(det(matrix(NaN,2,2)))
Since you're referencing the "solve" problem here, again, it's not.

As I was explaining the the previous e-mail, there are at least two  
completely separate issues - handling of NaNs in solve and  
determinant of NaN matrices. The latter is a bug in vecLib, the first  
one is not an OS X specific problem. Many R functions will object to  
taking NaN inputs such as qr.solve which was the previous  
implementation of solve. At any rate this is error handling in R and  
not Lapack. The "example" on the top doesn't make any sense because  
when you type "f" you know that it doesn't exist and both are R  
errors. If you used that in a script you have both choices: abort and  
that point or continue with whatever fallback you choose.

Cheers,
Simon