# Derivative of matrix w.r.t vector [duplicate]

I'm quite out of my element trying to do some matrix calculus.

I would like to know what the derivative of $z^{T}y$ w.r.t $z$ is, where z, y are n length vectors.

Can anyone suggest good resources as well?

Thank you!

• The derivative with respect to $z$ implies calculating the derivative in each component of $z$. for example, the derivative in component $z_1$ is $y_1$. Can you finish it from here? – Alex R. Feb 5 '17 at 0:11
• So since $z^{T}y$ is a n by n matrix do I calculate the derivative of each element w.r.t each element in $z$? – Daniel Cole Feb 5 '17 at 1:23
• $z^Ty$ is a scalar. $z$ is a vector (well, also a $n\times 1$ matrix). – Alex R. Feb 5 '17 at 1:24
• I recently posted a thorough discussion of such derivatives at stats.stackexchange.com/a/257616/919. Because the the map $z\to z^\prime y$ is linear, it is its own derivative: it linearly approximates itself. Our site has several threads on resources about matrix calculations: see stats.stackexchange.com/search?q=matrix+cookbook. – whuber Feb 5 '17 at 17:18