I need to find gradient and hessian of the following function
$$ \psi(F) = ||F - RC||^2_F $$ w.r.t $F$. Where $C$ is constant and $R$ comes from polar decomposition of $F = RS$, where $R$ - rotational part and $S$ - "scale", $||A||^2_F$ - just sum of squares of elements of matrix $A$.
Can somebody explain me how to compute such derivative? Also it would be really awesome if somebody can advice me some good mathematical tool for taking derivatives of functions which involves polar decomposition. Maybe matrix differentials?
$ \def\p{{\partial}} \def\grad#1#2{\frac{\p #1}{\p #2}} \def\hess#1#2#3{\frac{\p^2 #1}{\p #2\,\p #3^T}} $Use a colon to denote the trace/Frobenius product $$\eqalign{ A:B &= \sum_{i=1}^m \sum_{j=1}^n A_{ij} B_{ij} \;=\; {\rm Tr}(AB^T) \\ A:A &= \big\|A\big\|^2_F \\ }$$ Assume that $R$ is constant so that $$\eqalign{dF &= R\;dS\qquad\qquad\qquad}$$ and calculate the differential and gradient of the function. $$\eqalign{ \psi &= \big\|F-RC\big\|^2_F \\ &= \big\|R(S-C)\big\|^2_F \\ &= \big\|S-C\big\|^2_F \\ &= (S-C):(S-C) \\ d\psi &= 2(S-C):dS \\ &= 2(S-C):(R^TR)\,dS \\ &= 2R(S-C):dF \\ &= 2(F-RC):dF \\ \grad{\psi}{F} &= 2(F-RC) \\ }$$ Assuming that $S$ is constant $\big(dF=dR\;S\big)$ yields the same result. $$\eqalign{ \psi &= \big\|R(S-C)\big\|^2_F \\ &= R(S-C):R(S-C) \\ d\psi &= 2R(S-C):dR\;S \\ &= 2(F-RC):dF \\ \grad{\psi}{F} &= 2(F-RC) \\ }$$