Pretty obviously, the results should be consistent, but which case
are we going to say is "right"?
I'd argue that a 1x1 matrix should be treated as a scalar in any computations, so the
former (m1'*m2) is "right."
FWIW, in Gauss/Oxgauss both expressions produce the identical result (6*I(3)). Matlab
doesn't allow the x'y operation -- only x'*y.
PS
-----Original Message-----
From: gretl-users-bounces(a)lists.wfu.edu [mailto:gretl-users-bounces@lists.wfu.edu] On
Behalf Of Allin Cottrell
Sent: Friday, December 07, 2012 11:53 AM
To: Gretl list
Subject: Re: [Gretl-users] pre-multiplication by transpose
On Fri, 7 Dec 2012, Sven Schreiber wrote:
Am 07.12.2012 12:22, schrieb Stefano Fachin:
> I bumped into a feature of Hansl that may be produce puzzling results:
> using the "pre-multiplication by transpose" notation X'Y with X a 1x1
> matrix (that is, defined as a matrix, but with 1 row and 1 column,
> for instance because the result of the product of a row vector for a
> column
> vector) produces the "non conformable data type" error, while using
> the full syntax X'*Y os ok.
what version are you using? I'm not getting this behavior on a
November build of gretl (on Linux).
Hmm, I am seeing that on current CVS:
<hansl>
matrix m1 = 2*ones(1,1)
matrix m2 = 3*I(3)
matrix m3 = m1'*m2 # no error flagged
m3
m3 = m1'm2 # error flagged here
</hansl>
Pretty obviously, the results should be consistent, but which case are we going to say is
"right"?
Allin
_______________________________________________
Gretl-users mailing list
Gretl-users(a)lists.wfu.edu
http://lists.wfu.edu/mailman/listinfo/gretl-users