From: stephen on 21 Jul 2010 09:15 Hi, I have a matrix algebra question. I have a unkown 1x9 vector A (which is value for each security) and a known 8x9 matrix B (which has key rate DV01 for each security. And I also have another 8x1 vector C. To solve for A, B*A'=C A'=inv(B)*C A=(inv(B)*C)' But the problem is B is not a square matrix and could not solve for its inverse. Anyone knows a way to get around it and solve for A? Thanks for your help. Stephen
From: John D'Errico on 21 Jul 2010 09:27 "stephen" <huangj5(a)nationwide.com> wrote in message <i26rss$l8g$1(a)fred.mathworks.com>... > Hi, I have a matrix algebra question. > > I have a unkown 1x9 vector A (which is value for each security) and a known 8x9 matrix B (which has key rate DV01 for each security. And I also have another 8x1 vector C. > To solve for A, > B*A'=C > A'=inv(B)*C > A=(inv(B)*C)' > > But the problem is B is not a square matrix and could not solve for its inverse. Anyone knows a way to get around it and solve for A? > > Thanks for your help. > > Stephen One solution is just A = (B\C)'; Note that your problem is rank deficient, so one of the unknown elements of A will be zero. A different solution arises from pinv. A = (pinv(B)*C)'; John
From: stephen on 21 Jul 2010 11:36 Very helpful. Thanks! "John D'Errico" <woodchips(a)rochester.rr.com> wrote in message <i26sjo$7s3$1(a)fred.mathworks.com>... > "stephen" <huangj5(a)nationwide.com> wrote in message <i26rss$l8g$1(a)fred.mathworks.com>... > > Hi, I have a matrix algebra question. > > > > I have a unkown 1x9 vector A (which is value for each security) and a known 8x9 matrix B (which has key rate DV01 for each security. And I also have another 8x1 vector C. > > To solve for A, > > B*A'=C > > A'=inv(B)*C > > A=(inv(B)*C)' > > > > But the problem is B is not a square matrix and could not solve for its inverse. Anyone knows a way to get around it and solve for A? > > > > Thanks for your help. > > > > Stephen > > One solution is just > > A = (B\C)'; > > Note that your problem is rank deficient, so one of the > unknown elements of A will be zero. > > A different solution arises from pinv. > > A = (pinv(B)*C)'; > > John
|
Pages: 1 Prev: Find coresponding values in two matrices Next: problem in connecting XBee(please help) |