need help with differentiation

Started by
17 comments, last by grhodes_at_work 17 years, 5 months ago
is it possible to compute the derivative of y^{T}(K+C)^{-1}y with respect to either K or C? Can the answer even be computed simply? y is a vector and K and C are square matrices. thanks Shaobo
Just because it is not nice, doesn''t mean it is not miraculous.
Advertisement
If it can be computed simply something like a TI-92 will spit out something or choke.
At least that's what I used to use when I had a question like yours or even better use mathematica or some other symbolic differentation software.
[size="2"]Don't talk about writing games, don't write design docs, don't spend your time on web boards. Sit in your house write 20 games when you complete them you will either want to do it the rest of your life or not * Andre Lamothe
Quote:Original post by daviangel
If it can be computed simply something like a TI-92 will spit out something or choke.
At least that's what I used to use when I had a question like yours or even better use mathematica or some other symbolic differentation software.


What is a TI-92?

I don't have access to Mathematica, is it more advanced than matlab's symbolic toolbox? That does not appear to have direct support for linear algebra, making the differentiation somewhat difficult.

Any suggestions for good symbolic differentiation softwares that can handle linear algebra?
Just because it is not nice, doesn''t mean it is not miraculous.
A TI-92 is a calculator made by Texas Instruments (TI). I have a TI-83 Plus, but I doubt it could compute that, I don't know how to differentiate a vector or take a vector to a power of a matrix or whatever that equation says. Anyways, a TI-92 is a very good graphing calclulator that is really great for derivitives and intergals and what not.
[size=2][ I was ninja'd 71 times before I stopped counting a long time ago ] [ f.k.a. MikeTacular ] [ My Blog ] [ SWFer: Gaplessly looped MP3s in your Flash games ]
This appears quite off topic to me. It looks like an academic problem.

Forum FAQ
Graham Rhodes Moderator, Math & Physics forum @ gamedev.net
Partial differentiation with respect to a component I can understand, but with respect to a whole matrix, how is that defined? Is it defined?
Quote:Original post by DaBookshah
Partial differentiation with respect to a component I can understand, but with respect to a whole matrix, how is that defined? Is it defined?

Maybe if we had more info on how this original problem relates to game programming we would have a better idea?
[size="2"]Don't talk about writing games, don't write design docs, don't spend your time on web boards. Sit in your house write 20 games when you complete them you will either want to do it the rest of your life or not * Andre Lamothe
Quote:Original post by daviangel
Quote:Original post by DaBookshah
Partial differentiation with respect to a component I can understand, but with respect to a whole matrix, how is that defined? Is it defined?

Maybe if we had more info on how this original problem relates to game programming we would have a better idea?


well, it may be slightly off topic but I am trying to compute is fairly general. I am basically trying compute the derivative of the Mahalanobis distance http://en.wikipedia.org/wiki/Mahalanobis_distance. Since the result is a scalar, derivative with respect to the matrix K should be another matrix.

I use it as part of an algorithm to cluster some animation data.
Just because it is not nice, doesn''t mean it is not miraculous.
Computing the derivative of yTC-1y:

(C+E)-1=(C(I+C-1E))-1=(I+C-1E)-1C-1=(I-C-1E+C-1EC-1E-...)C-1=C-1-C-1EC-1+O(||E||2),

so

yT(C+E)-1y=yTC-1y-yTC-1EC-1y+O(||E||2)

and there you have your linear functional (-(yTC-1)•(C-1y)). If you want it in a standard form tr •X, take X=-(C-1y)(yTC-1)=-||y||2C-2, but for raw calculations the form above is just as good.

disclaimer: I assume no responsibility for mangled signs and inappropriate transposes.
thanks very much, it looks promising, from what little I know of matrix inversion identities. I was trying to work it out from the matrix inversion lemma but I wasn't quite clever enough.

Anyway, I'll let you know how I get on with it.

Quote:Original post by Darkstrike
Computing the derivative of yTC-1y:

(C+E)-1=(C(I+C-1E))-1=(I+C-1E)-1C-1=(I-C-1E+C-1EC-1E-...)C-1=C-1-C-1EC-1+O(||E||2),



Actually, if you can give some sort of short explanation for what is happening here, that would be great. It looks like some sort of taylor expansion is going on. And what does this O(||E||2) mean?

thanks

[Edited by - shaobohou on November 11, 2006 9:28:43 AM]
Just because it is not nice, doesn''t mean it is not miraculous.

This topic is closed to new replies.

Advertisement