Path: news.mathworks.com!not-for-mail From: "leo nidas" <bleonidas25@yahoo.gr> Newsgroups: comp.soft-sys.matlab Subject: matrix derivative Date: Fri, 19 Mar 2010 10:04:06 +0000 (UTC) Organization: The MathWorks, Inc. Lines: 44 Message-ID: <hnvi6m$2jn$1@fred.mathworks.com> Reply-To: "leo nidas" <bleonidas25@yahoo.gr> NNTP-Posting-Host: webapp-03-blr.mathworks.com Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: fred.mathworks.com 1268993046 2679 172.30.248.38 (19 Mar 2010 10:04:06 GMT) X-Complaints-To: news@mathworks.com NNTP-Posting-Date: Fri, 19 Mar 2010 10:04:06 +0000 (UTC) X-Newsreader: MATLAB Central Newsreader 1194208 Xref: news.mathworks.com comp.soft-sys.matlab:618188 I am confused with something rather simple which is embarrassing.. Let G=A(Y-μ). G is p by 1 matrix depending on β=[β0 β1 β(p-1)]'. (β is p by 1) Α is p by n matrix depending on β μ is n by 1 matrix depending on β Υ is n by 1 matrix independent of β I thought the derivative of G with respect to β (let dG) would be dG=(dA)*(Y-μ)-Α*dμ. which is obviously wrong because the dG should be a p by p matrix. Α*dμ is p by p (which is encouraging!) but (Y-μ) is n by 1 and the dimensions would not agree. I checked the following: http://en.wikipedia.org/wiki/Matrix_calculus but did't get it.. I checked my calculus book of Ross and Finley and doesn't have anything. I checked my algebra book of Gilbert Strang and doesn't have anything. I searched the net with no luck and I decided to make an example in matlab, so just see how can I get the derivative of a matrix with respect to a vector I typed >> syms b0 b1 real >> b=[b0 b1]'; >> A=[b0*b1 b0*b1]; >> diff(A,'b') ans = [ 0, 0] which is not what I want. diff just fount=d the difference of the elements right? I would like the 2 by 2 derivative matrix of A with respect to b. My final goal is to get right the derivative of G=A(Y-μ) right. Thanx in advance for any answers.