[Rd] Re: [R-SIG-Mac] NaN and linear algebra

From: David Firth <d.firth_at_warwick.ac.uk>
Date: Mon 21 Mar 2005 - 09:25:58 GMT

I am sorry that I wasn't clear. All that I meant was that *this* problem can result in different behaviour in "ordinary" statistical applications. For example, if the objective function in a call to optim() involves calling one of these linear algebra routines, the result may be NaN (on systems other than Mac OS X) --- which optim will typically handle sensibly --- or something else (an error, or perhaps some consequence of getting 0 for the determinant) under Mac OS X .

Probably this was obvious to you. Apologies if I misled you into thinking that there was some other problem I knew about.

Best regards,
David

On 20 Mar, 2005, at 15:08, stefano iacus wrote:

> No, blas/veclib is tested, so aprt this extreme case you should report
> some other more commonly used cases in which something fails on OS X.
> This will help us to work it out.
> As said, I'll try some tests without using veclib and let you know.
>
> I've fowarded this mail to r-devel, which seems to be the right place,
> so for future msg on the subject please use r-devel.
> stefano
> On 19/mar/05, at 17:44, David Firth wrote:
>
>> Dear Don, Bill and Stefano
>>
>> Many thanks for your helpful replies on this. I do think this is
>> pretty serious: the example I gave is an extreme one, but in real
>> problems (e.g., calls to optim()) this sort of thing can and does
>> result in different behaviour on the Mac than on other systems. And
>> that has to be a Bad Thing.
>>
>> I'm unsure whether it is better to press Apple to improve vecLib, or
>> to test R with an alternative BLAS (and if successful, recommend
>> using that BLAS in place of vecLib). Or both. Unfortunately I don't
>> know enough about these routines and the relevant standards to pursue
>> either route myself.
>>
>> Best regards,
>> David
>>
>>>
>>>
>>> At 11:57 AM +0000 3/16/05, David Firth wrote:
>>>> 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
>>>>
>>>> _______________________________________________
>>>> R-SIG-Mac mailing list
>>>> R-SIG-Mac@stat.math.ethz.ch
>>>> https://stat.ethz.ch/mailman/listinfo/r-sig-mac
>>>
>>>
>>> --
>>> --------------------------------------
>>> Don MacQueen
>>> Environmental Protection Department
>>> Lawrence Livermore National Laboratory
>>> Livermore, CA, USA
>>> --------------------------------------
>>
>> _______________________________________________
>> R-SIG-Mac mailing list
>> R-SIG-Mac@stat.math.ethz.ch
>> https://stat.ethz.ch/mailman/listinfo/r-sig-mac
>>
>



R-devel@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Mon Mar 21 20:29:10 2005

This archive was generated by hypermail 2.1.8 : Mon 20 Feb 2006 - 03:21:02 GMT