5 ms·
Fortunately there is a website now capable of doing matrix calculus! http://www.matrixcalculus.org http://www.matrixcalculus.org Mathematica doesn't seem to be
by calebh 9y ago
Fortunately there is a website now capable of doing matrix calculus!
http://www.matrixcalculus.org http://www.matrixcalculus.org
Mathematica doesn't seem to be able to do matrix calculus, which surprised me quite a bit.
- parrt 9y agoWow! Great little calculator. Thanks for pointing us at it.
- BucketSort 9y agoIndeed, most tools surprisingly lack this ability. I was shocked when I needed to break my calculations down to a piece-wise form when doing matrix calc with SymPy.
- adyavanapalli 9y agoNote: This website presumes denominator layout, which is different from what is used in the guide.
- improbable22 9y agoMathematica can absolutely do all of this! D[ matrix ,x] ... or things like this: f[x_,y_] := x^2 + Sin[y] vars={x,y}; Table[ D[f[x,y],var1, var2], {var1,vars}, {var2,vars}] // MatrixForm
- SoerenL 9y agoBut how do you compute the derivative of x'Ax in Mathematica (x being a vector and A being a matrix)? What you have pointed out is only scalar derivatives, if I am not mistaken here.
- improbable22 9y agoLike this, perhaps? A = {{1,2},{3,4}} vec = {x^2, x^3} D[vec.A.vec, x] Or perhaps like this, again the table of derivatives: xvec = {x1,x2} Table[ D[xvec.A.xvec,x] ,{x,xvec}] (all untested... one typo caught...)
- claar 9y agohttp://www.wolframalpha.com/input/?i=D%5B%7Bx%5E2,+x%5E3%7D.%7B%7B1,2%7D,%7B3,4%7D%7D.%7Bx%5E2,+x%5E3%7D,+x%5D http://www.wolframalpha.com/input/?i=D%5B%7Bx%5E2,+x%5E3%7D....
- parrt 9y agoAdded Link to Wolfram Alpha...
- calebh 9y agoMathematica can definitely compute the derivatives if you fix the size of the matrix. This isn't very useful if you're trying to compute the derivative of an expression with arbitrary sized matrices.
- improbable22 9y agoYou can do general matrices too, what do you have in mind? aa[x_] = {{1, 2}, {3, 4}} x bb[x_] = {x^2, x^3} D[ a[x].b[x] , x, x] (* for any suitable tensors *) % /. {a -> aa, b -> bb}