Derivative of a 1D function involving matrix inversion

61 Views Asked by At

How do I compute the derivative of $$ f(x) = \frac{1}{2} \left(\mathbf{a} - x \mathbf{b}\right)^T (x \mathbf{A} + \mu \mathbf{I})^{-1} \left(\mathbf{a} - x \mathbf{b}\right), $$ where $\mathbf{a}$, $\mathbf{b}$ are column vectors, $\mathbf{A}$ is a square symmetric matrix, $\mathbf{I}$ is the identity matrix, and $\mu > 0$? Of course, we assume that $x$ is in the interior of the domain where the inverse is well-defined. If possible, I'd like to find a formula which avoids the need to compute the Eigendecomposition of $\mathbf{A}$.

1

There are 1 best solutions below

1
On BEST ANSWER

$ \def\o{{\tt1}}\def\p{\partial} \def\L{\left}\def\R{\right} \def\LR#1{\L(#1\R)} \def\BR#1{\Big(#1\Big)} \def\vecc#1{\operatorname{vec}\LR{#1}} \def\diag#1{\operatorname{diag}\LR{#1}} \def\Diag#1{\operatorname{Diag}\LR{#1}} \def\trace#1{\operatorname{Tr}\LR{#1}} \def\qiq{\quad\implies\quad} \def\grad#1#2{\frac{d #1}{d #2}} \def\c#1{\color{red}{#1}} $For typing convenience, define the variables $$\eqalign{ g &= {xb-a} &\qiq dg = b\;dx \\ H &= {xA + \mu I} &\qiq dH = A\;dx \\ K &= H^{-1} &\qiq dK = -K\,dH\,K \\ }$$ Use the above notation to write the objective function. Then calculate its differential and gradient. $$\eqalign{ f &= \frac{1}{2}\BR{g^TKg} \\ \\ df &= \frac{1}{2}\BR{dg^TKg\;+\;g^T\,dK\,g\;+\;g^TKdg} \\ &= \frac{1}{2}\BR{b^TKg\;-\;g^TKAKg\;+\;g^TKb}\,dx \\ \\ \grad{f}{x} &= \frac{1}{2}\BR{b^TKg\;-\;g^TKAKg\;+\;g^TKb} \\ }$$