I've been working on a particularly tricky problem and wanted to check my
math. The problem simply an inverse matrix calculus derivative problem.
Particularly:
diff( -1/2 *
transpose(invert(transpose(A)).(z-x)).(invert(transpose(A)).(z-x)), A),
where A is a matrix ( cholesky decomposition of a covariance matrix), and z
& x are vectors of the same length.
I ran into several problems:
1) Invert only works on matrices if they are given - I need a symbolic
matrix inversion for any sized matrix. I know differentiation of an
inverted matrix is possible (see
orion.uwaterloo.ca/~hwolkowi/matrixcookbook.pdf)
2) I tried other matrix calculus such as diff (transpose(x) . A . x, x),
but Maxima returned " 'diff(transpose(x)) . A". The correct answer is " x
. ( A + transpose(A) ) "
3) I have tried checking itensor and ctensor packages, but neither of them
seemed to support a symbolic inverse. I'm not sure that even if it did,
would I be able to differentiate the resulting expression.
4) Another thing I looked for, but couldn't find was a symbolic function
inverse. I know the identity " diff( inverse(f(x)), x) = 1 / ( 'diff(f (
inverse f( x ) ), x ) " (see
http://en.wikipedia.org/wiki/Inverse_functions_and_differentiation)
So I guess this is a feature request unless someone can tell me how to use
maxima to differentiate an expression (involving matrix inverses) with
respect to the matrix. Features specifically useful would be:
a) "Full" symbolic matrix inversion, which operates on any sized matrix and
does not require specifying its components.
b) Matrix calculus
c) Symbolic function inverses (along with the associated calculus rules)
or
d) Better itensor/centsor documentation demonstrating how to handle a
problem similar to mine.
Thank you in advance for any advice.