Derivative of Matrix-Vector Product

2.6k Views Asked by At

Assume $S_1$ and $S_2$ are two $n \times n$ (positive definite if that helps) matrices, $c_1$ and $c_2$ are two variables taking scalar form, and $u_1$ and $u_2$ are two $n \times 1$ vectors. In addition, $c_1+c_2=1$, but in the more general case of $m$ $S$'s, $u$'s, and $c$'s, the $c$'s also sum to 1.

What is the derivative of $(c_1 S_1+c_2 S_2)^{-1}(c_1 u_1+c_2 u_2)$ with respect to both $c_1$ and $c_2$?

2

There are 2 best solutions below

0
On

The condition that $S_1$ and $S_2$ are positive definite is relevant to the existence of the inverse in the definition of the function. I assume that it is taken as given that the inverse exists at the relevant values of $c_1$ and $c_2$. This would be true in particular if $c_1$ and $c_2$ were positive.

By symmetry, the same method will apply for $c_1$ and $c_2$, and we're basically differentiating the function $f(t)=(tA+B)^{-1}(tu+v)$, where $A$ and $B$ are matrices and $u$ and $v$ are column vectors. You can write this as $f(t)=g(t)h(t)$, where $g$ is a matrix valued function and $h$ is a vector valued function. By the product rule, $f'(t)=g'(t)h(t)+g(t)h'(t)$. So you just need to be able to determine $g'$ and $h'$. It is straightforward that $h'(t)=u$. You can also show that $g'(t)=-(tA+B)^{-1}A(tA+B)^{-1}$.

3
On

Since I did this initially unregistered, I can't seem to figure out how to get back in and add a comment instead of an answer. This is a bit long, but I am still having trouble resolving this problem satisfactorily. Also, I apologize for the formatting.

@Jonas Meyer I got similar answers to you the first time I had tried it. The problem I'm actually dealing with is more general and contains perhaps a c3, c4, or any higher number. However, one of these cs will always be defined as c=1-sum(other cs).

In the simpler problem, S^-1*(c1*u1+c2*u2), if you assume c1 and c2 are independent, then the derivative wrt c1 is S^-1*u1 as I said above. This answer makes quite a lot of sense with regards to my current problem. If S=c1*S1+c2*S2 and S1=S2, I also found the answer that you have in the reply, S^-1*(u1-c1*u1-c2*u2). The problem is that this isn't consistent with what is above. This is a portfolio management problem. The first answer will give the equivalent of a portfolio with confidence c1=100% in the u1 view, while the second will give the difference between that view and the blended final portfolio. I am trying to address how much the confidences c1 and c2 are responsible for the final portfolio weights. In the first case, it is obvious: Multiply S^-1*u1 by c1 since it is homogeneous and divide by S^-1*(c1*u1+c2*u2). It is not obvious in the case of S^-1*(u1-c1*u1-c2*u2). For instance, if c1=100% and c2=0%, then the first case will show 100% of the weights are driven by c1 and 0% are driven by c2. The second case will say the contribution is 0% for c1. Something is mistaken here.

If c2=1-c1, then the derivative wrt c1 is S^-1*(u1-u2). For the more complicated case, where S=c1*S1+c2*S2=S2+c1*(S1-S2), the derivative wrt c1 can be calculated using what is in the answer and there will a term in one part so that if S1=S2 then it falls out and the answer becomes S^-1*(u1-u2). So if you assume c2=1-c1, I think you can get consistent answers between the case with 1 S and the case with 2 Ss. However, it still doesn't resolve my problems when you multiply the derivative wrt c1 by c1 and divide by S^-1*(c1*u1+c2*u2). This number will not provide the relative contributions from c1 to the portfolio weights.