Re: How to calculate the derivative of matrix w.r.t another matrix?
- To: mathgroup at smc.vnet.net
- Subject: [mg46715] Re: How to calculate the derivative of matrix w.r.t another matrix?
- From: Paul Abbott <paul at physics.uwa.edu.au>
- Date: Tue, 2 Mar 2004 19:10:13 -0500 (EST)
- Organization: The University of Western Australia
- References: <c215ts$8gh$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
In article <c215ts$8gh$1 at smc.vnet.net>, "Fred" <f0z6305 at labs.tamu.edu> wrote: > I have a problem of calculating the derivative of dxm matrix A with respect > to another dxm matrix B, > where A= [a1 a2 ... am] and B =[b1 b2 ... bm] with > ai and bj are vectors. one matrix with respect to another! That would mean something else altogether. It looks like you are after an element by element operation. > Actually the matrix A itself is the first order derivative > of a scalar J with respect to B, i.e., A = dJ/dB, > where a1 = dJ/db1, a2 = dJ/db1, and so on. This is an extension of the gradient operator. For example, for specified b, say b = {{x, y}, {z, t}}; and j, say j = x^2 + y^2 + z^2 - c t^2; you can compute dj/db using Outer: a = First[Outer[D, {j}, b]] > Now dA/dB is the second order derivative > dA/dB = dJ^2/(dBdB') > = [dJ/db1 dJ/db1 ... dJ/dbm]/d[b1 b2 ... bm]. > > So anybody have some idea on how to derive the formulation of dA/dB? Again, this is just an Outer product: Outer[D, a, b] Cheers, Paul -- Paul Abbott Phone: +61 8 9380 2734 School of Physics, M013 Fax: +61 8 9380 1014 The University of Western Australia (CRICOS Provider No 00126G) 35 Stirling Highway Crawley WA 6009 mailto:paul at physics.uwa.edu.au AUSTRALIA http://physics.uwa.edu.au/~paul