On 25/03/2025 21:11, Cottrell, Allin wrote:
On Tue, Mar 25, 2025 at 10:52 AM Riccardo (Jack) Lucchetti
<p002264(a)staff.univpm.it> wrote:
>
> On 25/03/2025 15:46, Sven Schreiber wrote:
>>
>> consider this with gretl 2025a:
>>
>> <console>
>> ? matrix hello = {1/0} # to get invalid input
>> ? = eigensym(hello)
>> Not a Number geschah bei Berechnung
>> ? = eigen(hello)
>> 1.#INF
>> ? = svd(hello)
>> nan
>> </console>
>>
>> So we have everything: a hard-stopping error, some IEEE code (?), and a
>> gretl code. Plus, with a 6x6 matrix input I also saw that eigen() spat
>> out a "Data error".
>
> Ouch
>
>> I think it would be good if this could be a little harmonized, no?
>
> Is it even possible to do without breaking backwards compatibility? I we
> don't care about that, I'd favour stopping with an error rather than
> returning NAs (FWIW, stopping with an error is what both Octave and R do).
A couple of comments. First "1.#INF" is Microsoft-specific, other
operating systems would just say "inf" or "-inf". Second, I
wouldn't
rush to make this sort of thing a hard error in all cases. What about
matrix results that contain some nans or infs along with valid values?
But there's clearly an inconsistency between svd() and eigensym() that
should be resolved one way or another.
I'd be ok either way, as long as the inconsistency is resolved and the
documentation is clear. Again, I have a slight preference for returning
an error since I can't think of a real-life situation when the attempt
to calculate the eigenvalues of a matrix containing NAs is not the
outcome of some previous mistake, but it's not something I'll put up a
fight on.
-------------------------------------------------------
Riccardo (Jack) Lucchetti
Dipartimento di Scienze Economiche e Sociali (DiSES)
Università Politecnica delle Marche
(formerly known as Università di Ancona)
r.lucchetti(a)univpm.it
http://www2.econ.univpm.it/servizi/hpp/lucchetti
-------------------------------------------------------