[Numpy-discussion] matrix default to column vector?
Tom K.
tpk@kraussfamily....
Sun Jun 7 14:29:55 CDT 2009
Robert Kern-2 wrote:
>
> On Sun, Jun 7, 2009 at 07:20, Tom K. <tpk@kraussfamily.org> wrote:
>> Going back to Alan Isaac's example:
>> 1) beta = (X.T*X).I * X.T * Y
> ...
> 4) beta = la.lstsq(X, Y)[0]
>
> I really hate that example.
>
Understood. Maybe propose a different one?
Robert Kern-2 wrote:
>
>
>> Seeing 1) with @'s would take some getting used but I think we would
>> adjust.
>>
>> For ".I" I would propose that ".I" be added to nd-arrays that inverts
>> each
>> matrix of the last two dimensions, so for example if X is 3D then X.I is
>> the
>> same as np.array([inv(Xi) for Xi in X]). This is also backwards
>> compatible.
>> With this behavior and the one I proposed for @, by adding preceding
>> dimensions we are allowing doing matrix algebra on collections of
>> matrices
>> (although it looks like we might need a new .T that just swaps the last
>> two
>> dimensions to really pull that off). But a ".I" attribute and its
>> behavior
>> needn't be bundled with whatever proposal we wish to make to the python
>> community for a new operator of course.
>
> I am vehemently against adding .I to ndarray. I want to *discourage*
> the formation of explicit inverses. It is almost always a very wrong
> thing to do.
>
You sound like Cleve Moler: always concerned about numeric fidelity. Point
taken.
- Tom K.
--
View this message in context: http://www.nabble.com/matrix-default-to-column-vector--tp23652920p23914438.html
Sent from the Numpy-discussion mailing list archive at Nabble.com.
More information about the Numpy-discussion
mailing list