[Numpy-discussion] Who uses matrix?

Paulo J. S. Silva pjssilva at ime.usp.br
Wed May 10 03:57:02 EDT 2006


Bill Baxter wrote:

> Ok, fair enough.   I think what I was trying to express is that it's
> rarely useful to have such a thing as a 1x1 matrix in linear algebra.
> For instance, I can't recall a single textbook or journal article I've
> read where a distinction was made between a true scalar product
> between two vectors <x,y> and the 1x1 matrix resulting from the matrix
> product of, x^t * y.  But I'll admit that most of what I read is more
> like applied math than pure math.  On the other hand, I would expect
> that most people trying to write programs to do actual calculations
> are also going to be more interested in practical applications of math
> than math theory. 
> 
> 
> Also, if you want to get nit-picky about what is correct in terms of
> rigorous math, it rasies the question as to whether it even makes any
> sense to apply .sum() to an element of R^n x R^m.   In the end Numpy
> is a package for performing practical computations. 

+1.

1x1 matrices usually appear when we compute a inner product. I also read
(and write) lots (fewer) papers and it is very usual to define the
(real) inner product as x.T*y (where x and y are column vectors: nx1
matrices). Of course this is an abuse of notation as the inner product
should return a real number. As you see Mathematics does this sometimes,
an abuse of notation.

Actually, I feel that matrices are very important in numpy, for the
compatibility reasons cited before. You can call me lazy, but my mind 
really prefer the second option below:

> inverse( dot(transpose(a), a) ) instead of (a.T*a).I

Best,

Paulo

-- 
Paulo José da Silva e Silva 
Professor Assistente do Dep. de Ciência da Computação
(Assistant Professor of the Computer Science Dept.)
Universidade de São Paulo - Brazil

e-mail: pjssilva at ime.usp.br      Web: http://www.ime.usp.br/~pjssilva

Teoria é o que não entendemos o     (Theory is something we don't)
suficiente para chamar de prática.  (understand well enough to call
practice)





More information about the NumPy-Discussion mailing list