Derivative of a matrix and vector product

632 Views Asked by At

Suppossing $M$ is a $n \times n$ matrix and z is a $n \times 1$ row, and I know the following identity:

$$ \frac{\partial z^tM}{\partial z} = M $$

but I want to solve for the following:

$$ \frac{\partial z^tM}{\partial M} = ?$$

Also, how would other factors like say another matrix $N$ independent of M be

$$ \frac{\partial z^tMN}{\partial M } = ?$$

1

There are 1 best solutions below

0
On BEST ANSWER

Just use the definition. Your vector has components $(z^TM)_i = \sum_{j} z_jM_{ji}$, hence the derivative with respect to $M_{pq} $ is equal to $$\frac{\partial(z^TM)_i }{\partial M_{pq}} = \frac{\partial\left(\sum_{j} z_jM_{ji}\right) }{\partial M_{pq}}=\begin{cases}0,&i\ne q,\\z_p,&i=q.\end{cases}$$ Note that if $i\ne q$, then the elements $M_{pq}$ do not take part in the sum in the numerator.

UPD: you can apply the same technique if you study $\frac{\partial(z^TMN)_i }{\partial M_{pq}}$.