I am struggling with the dimensions of matrices in the following problem: $$J(y)=\sum_{k=1}^p (y(t)y^T(t-T_k))^2,$$ where $y(t)=W^Tx(t)$.
In this problem, the size of $x(t)$ is $N×M$ and $W$ is $N×1$ so $y(t)$ is $1×M$. I need to find the second derivative of $J$ with respect to $W$. I know that the first derivative of $J$ is $$2\sum_{k=1}^p [(y(t)y^T(t-T_k))][x(t)y^T(t-T_k)+x(t-T_k)y^T(t)],$$ and based on my calculations the second derivative would be $$2\sum_{k=1}^p [x(t)y^T(t-T_k)+x(t-T_k)y^T(t)][x(t)y^T(t-T_k)+x(t-T_k)y^T(t)]\\ +(y(t)y^T(t-T_k)[x(t)x^T(t-T_k)+x(t-T_k)x^T(t)].$$
My problem is that considering the dimensions of the matrices there is a mismatch between the dimensions of the first part of the second equation. To be more clear, the sizes of the matrices in the term $$[x(t)y^T(t-T_k)+x(t-T_k)y^T(t)][x(t)y^T(t-T_k)+x(t-T_k)y^T(t)]$$ are both $N×1$, which results into not being able to calculate the multiplication. Is this the correct way to find the derivative of these equations?