I want to compute the derivative of:
$\frac{\partial y^T C^{-1}(\theta)y}{\partial \theta_{k}}$,
(Note that C is a covariance matrix that depends on a set of parameters $\theta$)
for which I used the chain rule: $ \frac{\partial y^T C^{-1}(\theta)y}{\partial \theta_{k}}= \frac{\partial y^T C^{-1}(\theta)y}{\partial C(\theta) } \frac{\partial C(\theta) }{\partial \theta_{k}}$.
Using eq. 61 from the Matrix Cookbook (http://www2.imm.dtu.dk/pubdb/views/edoc_download.php/3274/pdf/imm3274.pdf) I got:
$ \frac{\partial y^T C^{-1}(\theta)y}{\partial \theta_{k}}= \left[-C^{-1}(\theta)y y^{T}C^{-1}(\theta) \right]\frac{\partial C(\theta) }{\partial \theta_{k}}$.
However, this results in a matrix times a matrix ans I must obtain a scalar, I cant figure where my derivation is wrong.