Derivative of a matrix with respect to a scalar variable

202 Views Asked by At

Given: $f : \mathbb{R} \to \mathbb{R}$ with $$f(x) = y^{\top} v(1_n^{\top}v)^{-1}v^{\top}y$$ where $y,v,1_n \in \mathbb{R}^n$ with $1_n^{\top} = (1,\ldots,1)$. Only the elements of $v$ depend on the scalar variable $x \in \mathbb{R}$, i.e. $v = (v_1(x), \ldots,v_n(x))^{\top}$.

I need $f'(x) = \frac{\partial f}{\partial x}$. With $P=v(1_n^{\top}v)^{-1}v^{\top}$ I can easily show that $f'(x) = y^{\top} \frac{\partial P}{\partial x} y$. Any hints for a closed form of $\frac{\partial P}{\partial x}$ are really appreciated!

1

There are 1 best solutions below

1
On BEST ANSWER

Since $\;v^Ty=y^Tv,\;$ you can write the function as $$\eqalign{ f &= \frac{(y^Tv)^2}{1^Tv} \\ }$$ Then the derivative is $$\eqalign{ df &= \frac{(1^Tv)\;d(y^Tv)^2-(y^Tv)^2\,d(1^Tv)}{(1^Tv)^2} \\ &= \bigg(\frac{2(1^Tv)(y^Tv)y - (y^Tv)^21}{(1^Tv)^2}\bigg)^T\,dv \\ \frac{df}{dx} &= \bigg(\frac{2(1^Tv)(y^Tv)y - (y^Tv)^21}{(1^Tv)^2}\bigg)^T \bigg(\frac{dv}{dx}\bigg) \\ &= \bigg(\frac{(2y^Tv)\,y - (f)\,1}{1^Tv}\bigg)^T \bigg(\frac{dv}{dx}\bigg) \\ }$$