For instance, is there some way I can say "let A and B be arbitrary real $m\times n$ and $k\times m$ matrices, Simplify[Transpose[Transpose[A].Transpose[B]]]" and Mathematica would simplify it to B.A?
I know I can set A and B to be matrices containing symbols (e.g. A = Table[Subscript[a,i,j],{i,m},{j,n}]), but results can get quite messy if the problem is more complex than Transpose[Transpose[A].Transpose[B]]
EDIT: To answer @Searke and @Artes questions in the comments: I'm currently watching this Stanford online machine learning course. If you look at the lecture notes, pages 8-11, you see a some matrix calculations. I can follow these calculations with pen and paper, but I haven't found a way to derive e.g. this result from page 11 using Mathematica:

Answer
Indeed this is a one liner in NCAlgebra:
<< NC`
<< NCAlgebra`
NCGrad[1/2 (x ** z - y)^T ** (x ** z - y), z]
which results in
-y^T ** x + z^T ** x^T ** x
Comments
Post a Comment