Derivative of 4-norm of matrix-vector product

derivativeslinear algebramatrices

I need the derivative of the following

$$ \Biggl\| \frac{\mathbf{1}^{T}(M – M_0) }{\mathbf{1}^{T}M}\Biggr\|_4^4 $$

w.r.t. the matrix $M \in \mathbb{R}^{B \times N}$ where $\mathbf{1}^{B \times 1}$ is a column vector of ones and $M_0$ is a constant of the same dimension as $M$. The case of $\| . \|_2$ was answered here derivative of inverse of matrix-vector product

Best Answer

For convenience, define the ${\tt1}\in{\mathbb R}^B$ all-ones vector and the following ${\mathbb R}^N$ vectors $$\eqalign{ a &= M^T{\tt1},\quad b = M_0^T{\tt1},\quad c = \frac{a-b}{a}= ({\tt1}-b\oslash a) \\ w &= 4\,c\odot c\odot c\odot b\oslash a\oslash a \\ }$$ and the associated diagonal matrices $$\eqalign{ A &= {\rm Diag}(a),\quad B= {\rm Diag}(b),\quad C= {\rm Diag}(c)= (I-BA^{-1}) \\ W &= 4BA^{-2}C^3 \\ dC &= -B\,dA^{-1}= BA^{-2}dA \\ }$$

Then the function of interest can be written as $$\eqalign{ \psi &= \|C\|_4^4 \\&= I:C^4 \\ d\psi &= I:4C^3dC \\ &= 4C^3:BA^{-2}dA \\ &= W:dA \\ &= w:da \\ &= w : dM^T{\tt1} \\ &= {\tt1}w^T : dM \\ \frac{\partial\psi}{\partial M} &= {\tt1}w^T \\ \\ }$$ In the above, the symbol $(\odot)$ denotes elementwise multiplication, $(\oslash)$ denotes elementwise division, and $(:)$ represents the trace/Frobenius product, i.e. $$A:B = {\rm Tr}(A^TB)$$ Note that the $\{A,B,C,W\}$ matrices are diagonal and therefore they commute with each other, while the $M$ matrix is rectangular and does not commute with anything.